Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
rebpdx committed Jan 25, 2018
2 parents 72520a9 + 6ce42fe commit c9dc2fc
Show file tree
Hide file tree
Showing 115 changed files with 27,119 additions and 1,191 deletions.
71 changes: 71 additions & 0 deletions .github/ISSUE_TEMPLATE.md
@@ -0,0 +1,71 @@
<!--
Thanks for filing an OSCC issue! You're making our ecosystem a better place!
Below are some templates to get you started, filling out any that are relevant
to this issue will help us a lot! Feel free to delete any information or text
that isn't relevant to your issue.
-->

<!-- Questions about purchasing and pricing for OSCC boards or DriveKit?
Shoot an email to drivekit@polysync.io -->



<!--
Technical issue template.
Are you having a technical issue? Fill in the following blocks to help us
tackle it!
-->

### Expected behavior
<!-- What should be happening? -->

### Actual behavior
<!-- What behavior are you seeing? -->

### Steps to reproduce
<!-- How can we make it happen too? -->

### Version info
- _What's the output of running `git describe --tags` in your OSCC directory?_
- _Is this the same version flashed onto the hardware?_

### Hardware info
<!-- Are you using a custom board or something received from us? -->



<!--
Feature/changes issue template.
Are you interested in a new feature or a change to something that exists?
Fill in the following blocks to help us understand it!
-->

### Proposed feature or changes
<!-- What would you like to accomplish? -->

### Use case
<!-- How would you like to do it? -->



<!--
Documentation issue template.
Have you found a bug in documentation or wish something was documented that
isn't? Fill in the following blocks to help us help you!
-->

### Documentation expected
<!-- What information would help you? Where would you expect to find it? -->

### Documentation available
<!-- What were you able to find? Was it in the right spot? -->


<!--
Is your issue something that doesn't fit any of the templates above?
Let us know here!
-->
14 changes: 9 additions & 5 deletions Jenkinsfile
Expand Up @@ -22,8 +22,10 @@ node('arduino') {
sh 'cd firmware && mkdir build_kia_soul_petrol_unit_tests && cd build_kia_soul_petrol_unit_tests && cmake .. -DKIA_SOUL=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-unit-tests'
echo 'Kia Soul Petrol Unit Tests Complete!'
}, 'kia soul petrol property-based tests': {
sh 'cd firmware && mkdir build_kia_soul_petrol_property_tests && cd build_kia_soul_petrol_property_tests && cmake .. -DKIA_SOUL=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-property-tests'
echo 'Kia Soul Petrol Property-Based Tests Complete!'
withEnv(["PATH+CARGO=$HOME/.cargo/bin"]) {
sh 'cd firmware && mkdir build_kia_soul_petrol_property_tests && cd build_kia_soul_petrol_property_tests && cmake .. -DKIA_SOUL=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-property-tests'
echo 'Kia Soul Petrol Property-Based Tests Complete!'
}
}
echo 'Kia Soul Petrol Tests Complete!'
}
Expand All @@ -32,8 +34,10 @@ node('arduino') {
sh 'cd firmware && mkdir build_kia_soul_ev_unit_tests && cd build_kia_soul_ev_unit_tests && cmake .. -DKIA_SOUL_EV=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-unit-tests'
echo 'Kia Soul EV Unit Tests Complete!'
}, 'kia soul ev property-based tests': {
sh 'cd firmware && mkdir build_kia_soul_ev_property_tests && cd build_kia_soul_ev_property_tests && cmake .. -DKIA_SOUL_EV=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-property-tests'
echo 'Kia Soul EV Property-Based Tests Complete!'
withEnv(["PATH+CARGO=$HOME/.cargo/bin"]) {
sh 'cd firmware && mkdir build_kia_soul_ev_property_tests && cd build_kia_soul_ev_property_tests && cmake .. -DKIA_SOUL_EV=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-property-tests'
echo 'Kia Soul EV Property-Based Tests Complete!'
}
}
echo 'Kia Soul EV Tests Complete!'
}
Expand All @@ -44,4 +48,4 @@ node('arduino') {
finally {
deleteDir()
}
}
}
28 changes: 24 additions & 4 deletions README.md
Expand Up @@ -82,8 +82,16 @@ mkdir build
cd build
```

To generate Makefiles, tell `cmake` which platform to build firmware for. For example, if you want to build
firmware for the Kia Soul:
To generate Makefiles, tell `cmake` which vehicle to build for by supplying the
appropriate build flag:

| Vehicle | Flag |
| --------------- | ---------------- |
| Kia Soul Petrol | -DKIA_SOUL=ON |
| Kia Soul EV | -DKIA_SOUL_EV=ON |


For example, if you want to build firmware for the petrol Kia Soul:

```
cmake .. -DKIA_SOUL=ON
Expand All @@ -95,7 +103,7 @@ cmake .. -DKIA_SOUL=ON
cmake .. -DKIA_SOUL=ON -DSTEERING_OVERRIDE=OFF
```

If steering operator overrides remain enabled, the sensitivity can be adjusted by changing the value of the `TORQUE_DIFFERENCE_OVERRIDE_THRESHOLD` in the corresponding vehicle's header file.
If steering operator overrides remain enabled, the sensitivity can be adjusted by changing the value of the `TORQUE_DIFFERENCE_OVERRIDE_THRESHOLD` in the corresponding vehicle's header file.

* Lowering this value will make the steering module more sensitive to operator override, but will result in false positives around high-torque areas, such as the mechanical limits of the steering rack or when quickly and rapidly changing direction.
* Increasing this value will result in fewer false positives, but will make it more difficult to manually override the wheel.
Expand Down Expand Up @@ -209,10 +217,15 @@ strange behavior while printing that does not occur otherwise.
# Controlling Your Vehicle - an Example Application

Now that all your Arduino modules are properly setup, it is time to start sending control commands.

We've created an example application, joystick commander, that uses the OSCC API to interface with the firmware, allowing you to send commands using a game controller and receive reports from the on-board OBD-II CAN. These commands are converted into CAN messages, which the OSCC API sends to the respective Arduino modules and are used to actuate the vehicle.

[OSCC Joystick Commander](https://github.com/PolySync/oscc-joystick-commander)

We've also created a ROS node, that uses the OSCC API to interface with the firmware from ROS messages, allowing you to send commands and receive reports in ROS.

[ROSCCO](https://github.com/PolySync/roscco)

# OSCC API

**Open and close CAN channel to OSCC Control CAN.**
Expand Down Expand Up @@ -273,6 +286,13 @@ In order to receive reports from the modules, your application will need to regi
When the appropriate report for your callback function is received from the API's socket connection, it will then forward the
report to your software.

Each module's reports are described in their respective wiki sections:

* [Brake (EV)](https://github.com/PolySync/oscc/wiki/Firmware-Brake-%28EV%29#brake-report)
* [Brake (Petrol)](https://github.com/PolySync/oscc/wiki/Firmware-Brake-%28Petrol%29#brake-report)
* [Steering](https://github.com/PolySync/oscc/wiki/Firmware-Steering#steering-report)
* [Throttle](https://github.com/PolySync/oscc/wiki/Firmware-Throttle#throttle-report)

In addition to OSCC specific reports, it will also forward any non-OSCC reports to any callback function registered with
```subscribe_to_obd_messages```. This can be used to view CAN frames received from the vehicle's OBD-II CAN channel. If you know
the corresponding CAN frame's id, you can parse reports sent from the car.
Expand Down Expand Up @@ -420,7 +440,7 @@ make run-all-tests

# Additional Vehicles & Contributing

OSCC currently has information regarding the Kia Soul PS (2014-2016), but we want to grow! The
OSCC currently has information regarding the Kia Soul PS (2014-2018), but we want to grow! The
repository is structured to facilitate including more vehicles as more is learned about them.

In order to include information related to a new vehicle's specification, follow the format defined in ```api/include/vehicles/kia_soul.h``` and
Expand Down
27 changes: 27 additions & 0 deletions api/CMakeLists.txt
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 2.8)

project(osccapi)

include(${CMAKE_SOURCE_DIR}/OsccConfig.cmake)

set(INCLUDES ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
set(SOURCES ${CMAKE_SOURCE_DIR}/src/oscc.c)
set_source_files_properties(SOURCES PROPERTIES LANGUAGE C)

set(OBJECTS ${PROJECT_NAME}_objects)
set(SHARED_LIB ${PROJECT_NAME}_shared_lib)
set(STATIC_LIB ${PROJECT_NAME}_static_lib)

# Reuse object files for both shared and static libraries
# rather than recompiling for both
add_library(${OBJECTS} OBJECT ${SOURCES})
target_include_directories(${OBJECTS} PUBLIC ${INCLUDES})
set_target_properties(${OBJECTS} PROPERTIES POSITION_INDEPENDENT_CODE 1)

add_library(${SHARED_LIB} SHARED $<TARGET_OBJECTS:${OBJECTS}>)
set_target_properties(${SHARED_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
target_include_directories(${SHARED_LIB} PUBLIC ${INCLUDES})

add_library(${STATIC_LIB} STATIC $<TARGET_OBJECTS:${OBJECTS}>)
target_include_directories(${STATIC_LIB} PUBLIC ${INCLUDES})
set_target_properties(${STATIC_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})

0 comments on commit c9dc2fc

Please sign in to comment.