Skip to content

Commit c9dc2fc

Browse files
committed
Merge remote-tracking branch 'origin/devel'
2 parents 72520a9 + 6ce42fe commit c9dc2fc

115 files changed

Lines changed: 27119 additions & 1191 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<!--
2+
Thanks for filing an OSCC issue! You're making our ecosystem a better place!
3+
4+
Below are some templates to get you started, filling out any that are relevant
5+
to this issue will help us a lot! Feel free to delete any information or text
6+
that isn't relevant to your issue.
7+
-->
8+
9+
<!-- Questions about purchasing and pricing for OSCC boards or DriveKit?
10+
Shoot an email to drivekit@polysync.io -->
11+
12+
13+
14+
<!--
15+
Technical issue template.
16+
17+
Are you having a technical issue? Fill in the following blocks to help us
18+
tackle it!
19+
-->
20+
21+
### Expected behavior
22+
<!-- What should be happening? -->
23+
24+
### Actual behavior
25+
<!-- What behavior are you seeing? -->
26+
27+
### Steps to reproduce
28+
<!-- How can we make it happen too? -->
29+
30+
### Version info
31+
- _What's the output of running `git describe --tags` in your OSCC directory?_
32+
- _Is this the same version flashed onto the hardware?_
33+
34+
### Hardware info
35+
<!-- Are you using a custom board or something received from us? -->
36+
37+
38+
39+
<!--
40+
Feature/changes issue template.
41+
42+
Are you interested in a new feature or a change to something that exists?
43+
Fill in the following blocks to help us understand it!
44+
-->
45+
46+
### Proposed feature or changes
47+
<!-- What would you like to accomplish? -->
48+
49+
### Use case
50+
<!-- How would you like to do it? -->
51+
52+
53+
54+
<!--
55+
Documentation issue template.
56+
57+
Have you found a bug in documentation or wish something was documented that
58+
isn't? Fill in the following blocks to help us help you!
59+
-->
60+
61+
### Documentation expected
62+
<!-- What information would help you? Where would you expect to find it? -->
63+
64+
### Documentation available
65+
<!-- What were you able to find? Was it in the right spot? -->
66+
67+
68+
<!--
69+
Is your issue something that doesn't fit any of the templates above?
70+
Let us know here!
71+
-->

Jenkinsfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ node('arduino') {
2222
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'
2323
echo 'Kia Soul Petrol Unit Tests Complete!'
2424
}, 'kia soul petrol property-based tests': {
25-
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'
26-
echo 'Kia Soul Petrol Property-Based Tests Complete!'
25+
withEnv(["PATH+CARGO=$HOME/.cargo/bin"]) {
26+
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'
27+
echo 'Kia Soul Petrol Property-Based Tests Complete!'
28+
}
2729
}
2830
echo 'Kia Soul Petrol Tests Complete!'
2931
}
@@ -32,8 +34,10 @@ node('arduino') {
3234
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'
3335
echo 'Kia Soul EV Unit Tests Complete!'
3436
}, 'kia soul ev property-based tests': {
35-
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'
36-
echo 'Kia Soul EV Property-Based Tests Complete!'
37+
withEnv(["PATH+CARGO=$HOME/.cargo/bin"]) {
38+
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'
39+
echo 'Kia Soul EV Property-Based Tests Complete!'
40+
}
3741
}
3842
echo 'Kia Soul EV Tests Complete!'
3943
}
@@ -44,4 +48,4 @@ node('arduino') {
4448
finally {
4549
deleteDir()
4650
}
47-
}
51+
}

README.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,16 @@ mkdir build
8282
cd build
8383
```
8484

85-
To generate Makefiles, tell `cmake` which platform to build firmware for. For example, if you want to build
86-
firmware for the Kia Soul:
85+
To generate Makefiles, tell `cmake` which vehicle to build for by supplying the
86+
appropriate build flag:
87+
88+
| Vehicle | Flag |
89+
| --------------- | ---------------- |
90+
| Kia Soul Petrol | -DKIA_SOUL=ON |
91+
| Kia Soul EV | -DKIA_SOUL_EV=ON |
92+
93+
94+
For example, if you want to build firmware for the petrol Kia Soul:
8795

8896
```
8997
cmake .. -DKIA_SOUL=ON
@@ -95,7 +103,7 @@ cmake .. -DKIA_SOUL=ON
95103
cmake .. -DKIA_SOUL=ON -DSTEERING_OVERRIDE=OFF
96104
```
97105

98-
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.
106+
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.
99107

100108
* 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.
101109
* Increasing this value will result in fewer false positives, but will make it more difficult to manually override the wheel.
@@ -209,10 +217,15 @@ strange behavior while printing that does not occur otherwise.
209217
# Controlling Your Vehicle - an Example Application
210218

211219
Now that all your Arduino modules are properly setup, it is time to start sending control commands.
220+
212221
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.
213222

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

225+
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.
226+
227+
[ROSCCO](https://github.com/PolySync/roscco)
228+
216229
# OSCC API
217230

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

289+
Each module's reports are described in their respective wiki sections:
290+
291+
* [Brake (EV)](https://github.com/PolySync/oscc/wiki/Firmware-Brake-%28EV%29#brake-report)
292+
* [Brake (Petrol)](https://github.com/PolySync/oscc/wiki/Firmware-Brake-%28Petrol%29#brake-report)
293+
* [Steering](https://github.com/PolySync/oscc/wiki/Firmware-Steering#steering-report)
294+
* [Throttle](https://github.com/PolySync/oscc/wiki/Firmware-Throttle#throttle-report)
295+
276296
In addition to OSCC specific reports, it will also forward any non-OSCC reports to any callback function registered with
277297
```subscribe_to_obd_messages```. This can be used to view CAN frames received from the vehicle's OBD-II CAN channel. If you know
278298
the corresponding CAN frame's id, you can parse reports sent from the car.
@@ -420,7 +440,7 @@ make run-all-tests
420440

421441
# Additional Vehicles & Contributing
422442

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

426446
In order to include information related to a new vehicle's specification, follow the format defined in ```api/include/vehicles/kia_soul.h``` and

api/CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
3+
project(osccapi)
4+
5+
include(${CMAKE_SOURCE_DIR}/OsccConfig.cmake)
6+
7+
set(INCLUDES ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
8+
set(SOURCES ${CMAKE_SOURCE_DIR}/src/oscc.c)
9+
set_source_files_properties(SOURCES PROPERTIES LANGUAGE C)
10+
11+
set(OBJECTS ${PROJECT_NAME}_objects)
12+
set(SHARED_LIB ${PROJECT_NAME}_shared_lib)
13+
set(STATIC_LIB ${PROJECT_NAME}_static_lib)
14+
15+
# Reuse object files for both shared and static libraries
16+
# rather than recompiling for both
17+
add_library(${OBJECTS} OBJECT ${SOURCES})
18+
target_include_directories(${OBJECTS} PUBLIC ${INCLUDES})
19+
set_target_properties(${OBJECTS} PROPERTIES POSITION_INDEPENDENT_CODE 1)
20+
21+
add_library(${SHARED_LIB} SHARED $<TARGET_OBJECTS:${OBJECTS}>)
22+
set_target_properties(${SHARED_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})
23+
target_include_directories(${SHARED_LIB} PUBLIC ${INCLUDES})
24+
25+
add_library(${STATIC_LIB} STATIC $<TARGET_OBJECTS:${OBJECTS}>)
26+
target_include_directories(${STATIC_LIB} PUBLIC ${INCLUDES})
27+
set_target_properties(${STATIC_LIB} PROPERTIES OUTPUT_NAME ${PROJECT_NAME})

0 commit comments

Comments
 (0)