Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devel' into maint/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vertexmachina committed Jul 28, 2017
2 parents 96000f4 + 5162dba commit 7465133
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 33 deletions.
File renamed without changes.
47 changes: 14 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<img src="https://raw.githubusercontent.com/wiki/PolySync/OSCC/images/oscc_logo_title.png">

Joystick commander is an example application designed to show how the Open Source Car Control API can be used to recieve reports from and send commands to a drive-by-wire enabled vehicle.
Joystick commander is an example application designed to show how the Open Source Car Control API can be used to recieve reports from and send commands to a drive-by-wire enabled vehicle.
Using an SDL2 supported game controller, inputs are normalized and converted to relative torque, throttle, and brake commands. This application also demonstrates registering callback functions to recieve and parse OSCC reports as well as vehicle state reports from the car's OBD-II CAN network.

For more information about OSCC, check out our [github](https://github.com/PolySync/oscc).

# Pre-requisites:

OSCC's API and firmware modules are both required, and the modules must be installed on your vehicle. An SDL2 supported game controller is also required, and the SDL2 library and CANlib SDK need to be pre-installed. A CAN interface adapter, such as the [Kvaser Leaf Light](https://www.kvaser.com), is also necessary in order to connect the API to the OSCC control CAN network via USB. This application has been tested with a Logitech F310 gamepad and a wired Xbox 360 controller, but should work with any SDL2 supported game controller. Controllers with rumble capabilities will provide feedback when OSCC is enabled or disabled.
OSCC's API and firmware modules are both required, and the modules must be installed on your vehicle. An SDL2 supported game controller is also required, and the SDL2 library and CANlib SDK need to be pre-installed. A CAN interface adapter, such as the [Kvaser Leaf Light](https://www.kvaser.com), is also necessary in order to connect the API to the OSCC control CAN network via USB. This application has been tested with a Logitech F310 gamepad and a wired Xbox 360 controller, but should work with any SDL2 supported game controller. Controllers with rumble capabilities will provide feedback when OSCC is enabled or disabled.

[Xbox 360 Wired Controller](https://www.amazon.com/dp/B004QRKWLA)

[logitech-F310](http://a.co/3GoUlkN)
[Logitech Gamepad F310](http://a.co/3GoUlkN)

Install the SDL2 library with the command below.

Expand All @@ -21,23 +21,13 @@ sudo apt install libsdl2-dev

# Getting OSCC & Joystick Commander

If you haven't already, you'll need to install the OSCC hardware modules onto your target vehicle.
If you haven't already, you'll need to install the OSCC hardware modules onto your target vehicle.

Once you have the hardware installed and the firmware flashed, go into the root directory
of the joystick commander repository and clone the OSCC repository:

```
cd oscc-joystick-commander
git clone git@github.com:PolySync/oscc.git --branch v1.0
```

This will put all of the necessary OSCC files into a directory called `oscc` within
the joystick commander directory, which will know to look for them there when
it builds.
Once you have the hardware installed and the firmware flashed, navigate into your OSCC directory and clone the joystick commander repository. ```cd``` into the joystick_commander directory.

# Building Joystick Commander

From the joystick commander directory, run the following sequence to build it:
From this directory, run the following sequence to build joystick commander:

```
mkdir build
Expand All @@ -60,7 +50,7 @@ For example, with a Kvaser Leaf Light attached, using a bitrate of 500000 and a
You would then run:

```
./oscc-joystick-commander 0
./joystick-commander 0
```

For more information on setting up a socketcan interface, check out [this guide](http://elinux.org/Bringing_CAN_interface_up).
Expand All @@ -83,30 +73,20 @@ Joystick.c contains all of the functionality necessary to initialize and interac

### commander

The commander files contain all of joystick commander's interactivity with the OSCC API. It demonstrates opening and closing the CAN channel communications with OSCC's control CAN network, sending enable/disable commands to the modules through the API, retrieving OSCC reports through callback functions, and sending commands through OSCC's ```publish``` functions.
The commander files contain all of joystick commander's interactivity with the OSCC API. It demonstrates opening and closing the CAN channel communications with OSCC's control CAN network, sending enable/disable commands to the modules through the API, retrieving OSCC reports through callback functions, and sending commands through OSCC's ```publish``` functions.

# Using OSCC API

To use the OSCC API in your own applications, you just need to include any relevant header files.
* All of the can message protocols are located in the ```oscc/api/include/can_protocols/```
directory. These specify the structs we use for steering, throttle, brake, and
fault reports.

* Vehicle-specific macros and values are located in the ```oscc/api/vehicles/``` directory.
You only need to include "vehicles.h" which will include the vehicle-specific header for you,
based on the CMake option provided earlier (e.g., using ```-DKIA_SOUL=ON``` will
tell ```vehicles.h``` to include ```kia_soul.h``` for you).

To use the OSCC API in your own applications, you just need to include any relevant header files.
* All of the can message protocols are located in ```api/include/can_protocols.h```. These specify the structs we use for steering, throttle, brake, and fault reports.
* Vehicle specific macros and values are located in ```api/vehicles/*```.
* ```oscc.h``` includes all of the functionality you need to interface with the OSCC API.

# License Information

Hardware source materials (e.g. schematics, board layouts, wiring diagrams, data sheets, physical
installation documentation, 3D models, etc.) for the OSCC (Open Source Car Control) Project are
licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0).
MIT License

Firmware and software source for the OSCC (Open Source Car Control) Project is licensed under the
MIT License (MIT) unless otherwise noted (e.g. 3rd party dependencies, etc.).
Copyright (c) 2017 PolySync Technologies

Please see [LICENSE.md](LICENSE.md) for more details.

Expand All @@ -118,3 +98,4 @@ Please direct questions regarding OSCC and/or licensing to help@polysync.io.
*Distributed as-is; no warranty is given.*

Copyright (c) 2017 PolySync Technologies, Inc. All Rights Reserved.

0 comments on commit 7465133

Please sign in to comment.