Skip to content

Commit e4e4a8a

Browse files
committed
Merge branch 'devel'
2 parents dff841e + ea8e2c5 commit e4e4a8a

147 files changed

Lines changed: 57703 additions & 19529 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.

CONTRIBUTING.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ Below is a sample of how additional vehicle directories should be created.
7676

7777
- Code should conform to the [coding standard](#oscc-coding-standard)
7878
- Push your changes to a topic branch in your branch of the repository
79+
- Ideally, your commits would also be [GPG signed](https://help.github.com/articles/signing-commits-using-gpg/)
80+
- `git config --global commit.gpgSign true`
81+
- `git config --global gpg.program gpg2`
82+
- `git config --global push.gpgSign if-asked`
83+
- `git config --global user.signingKey <Your Public Key ID>`
7984
- Submit a pull request to the repository in the PolySync organization
8085
- Update your github issue to mark that you have submitted code and are ready for it to be reviewed (Status: Ready for Merge)
8186
- Include a link to the pull request in the ticket
@@ -197,6 +202,12 @@ Any changes to the OSCC modules must undergo a series of tests that conclude wit
197202
4. The regression test suite completes successfully
198203
5. The [system acceptance tests](#system-acceptance-testing) completes successfully (system acceptance test listed below, some parts automated)
199204
- Once all the status checks have passed, resolve any merge conflicts and merge the changed branch with devel
205+
1. The merge commit will need to be signed, which means local, command-line
206+
merge rather than GitHub UI.
207+
2. The [hub](https://hub.github.com/) tool can help with this.
208+
3. `git checkout devel`
209+
4. `hub merge --no-ff https://github.com/PolySync/oscc/pull/169`
210+
5. `git push origin devel`
200211

201212
## System Acceptance Testing
202213

Jenkinsfile

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,32 @@ node('arduino') {
1010
])
1111
}
1212
stage('Build') {
13-
parallel 'kia soul firmware': {
14-
sh 'cd firmware && mkdir build && cd build && cmake .. -DKIA_SOUL=ON -DCMAKE_BUILD_TYPE=Release && make'
13+
parallel 'kia soul petrol firmware': {
14+
sh 'cd firmware && mkdir build_kia_soul_petrol && cd build_kia_soul_petrol && cmake .. -DKIA_SOUL=ON -DCMAKE_BUILD_TYPE=Release && make'
15+
}, 'kia soul EV firmware': {
16+
sh 'cd firmware && mkdir build_kia_soul_ev && cd build_kia_soul_ev && cmake .. -DKIA_SOUL_EV=ON -DCMAKE_BUILD_TYPE=Release && make'
1517
}
1618
echo 'Build Complete!'
1719
}
18-
stage('Test') {
19-
parallel 'unit tests': {
20-
sh 'cd firmware && mkdir build_unit_tests && cd build_unit_tests && cmake .. -DKIA_SOUL=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-unit-tests'
21-
echo 'Unit Tests Complete!'
22-
}, 'property-based tests': {
23-
sh 'cd firmware && mkdir build_property_tests && cd build_property_tests && cmake .. -DKIA_SOUL=ON -DTESTS=ON -DCMAKE_BUILD_TYPE=Release && make run-property-tests'
24-
echo 'Property-Based Tests Complete!'
25-
}, 'acceptance tests': {
26-
echo 'Acceptance Tests Complete!'
20+
stage('Kia Soul Petrol Tests') {
21+
parallel 'kia soul petrol unit tests': {
22+
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'
23+
echo 'Kia Soul Petrol Unit Tests Complete!'
24+
}, '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!'
2727
}
28+
echo 'Kia Soul Petrol Tests Complete!'
2829
}
29-
stage('Release') {
30-
echo 'Release Package Created!'
30+
stage('Kia Soul EV Tests') {
31+
parallel 'kia soul ev unit tests': {
32+
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'
33+
echo 'Kia Soul EV Unit Tests Complete!'
34+
}, '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+
}
38+
echo 'Kia Soul EV Tests Complete!'
3139
}
3240
}
3341
catch(Exception e) {

README.md

Lines changed: 154 additions & 152 deletions
Large diffs are not rendered by default.

api/OsccConfig.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
if(KIA_SOUL)
2+
add_definitions(-DKIA_SOUL)
3+
elseif(KIA_SOUL_EV)
4+
add_definitions(-DKIA_SOUL_EV)
5+
else()
6+
message(FATAL_ERROR "No platform selected")
7+
endif()

api/include/can_protocols/brake_can_protocol.h

Lines changed: 65 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
#include "magic.h"
1414

1515

16+
/*
17+
* @brief Brake enable message (CAN frame) ID.
18+
*
19+
*/
20+
#define OSCC_BRAKE_ENABLE_CAN_ID (0x50)
21+
22+
/*
23+
* @brief Brake disable message (CAN frame) ID.
24+
*
25+
*/
26+
#define OSCC_BRAKE_DISABLE_CAN_ID (0x51)
27+
1628
/*
1729
* @brief Brake command message (CAN frame) ID.
1830
*
@@ -43,10 +55,48 @@
4355
*/
4456
#define OSCC_BRAKE_DTC_INVALID_SENSOR_VAL (0x0)
4557

58+
/*
59+
* @brief Brake DTC bitfield position indicating an operator override.
60+
*
61+
*/
62+
#define OSCC_BRAKE_DTC_OPERATOR_OVERRIDE (0x1)
63+
4664

4765
#pragma pack(push)
4866
#pragma pack(1)
4967

68+
/**
69+
* @brief Brake enable message.
70+
*
71+
* CAN frame ID: \ref OSCC_BRAKE_ENABLE_CAN_ID
72+
*
73+
*/
74+
typedef struct
75+
{
76+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
77+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
78+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
79+
80+
uint8_t reserved[6]; /*!< Reserved. */
81+
} oscc_brake_enable_s;
82+
83+
84+
/**
85+
* @brief Brake disable message.
86+
*
87+
* CAN frame ID: \ref OSCC_BRAKE_DISABLE_CAN_ID
88+
*
89+
*/
90+
typedef struct
91+
{
92+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
93+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
94+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
95+
96+
uint8_t reserved[6]; /*!< Reserved. */
97+
} oscc_brake_disable_s;
98+
99+
50100
/**
51101
* @brief Brake command message data.
52102
*
@@ -55,17 +105,21 @@
55105
*/
56106
typedef struct
57107
{
58-
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
59-
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
60-
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
108+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
109+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
110+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
61111

112+
#if defined(KIA_SOUL)
62113
uint16_t pedal_command; /*!< Pedal command. [65535 == 100%] */
63114

64-
uint8_t enable; /*!< Command to enable or disable steering control.
65-
* Zero value means disable.
66-
* Non-zero value means enable. */
115+
uint8_t reserved[4]; /*!< Reserved. */
116+
#elif defined(KIA_SOUL_EV)
117+
uint16_t spoof_value_low; /*!< Value to be sent on the low spoof signal. */
67118

68-
uint8_t reserved[3]; /*!< Reserved. */
119+
uint16_t spoof_value_high; /*!< Value to be sent on the high spoof signal. */
120+
121+
uint8_t reserved[2]; /*!< Reserved. */
122+
#endif
69123
} oscc_brake_command_s;
70124

71125

@@ -77,9 +131,9 @@ typedef struct
77131
*/
78132
typedef struct
79133
{
80-
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
81-
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
82-
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
134+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
135+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
136+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
83137

84138
uint8_t enabled; /*!< Braking controls enabled state.
85139
* Zero value means disabled (commands are ignored).
@@ -90,7 +144,7 @@ typedef struct
90144
* Non-zero value means an operator has physically overridden
91145
* the system. */
92146

93-
uint8_t dtcs; /* Bitfield of DTCs present in the module. */
147+
uint8_t dtcs; /*!< Bitfield of DTCs present in the module. */
94148

95149
uint8_t reserved[3]; /*!< Reserved. */
96150
} oscc_brake_report_s;

api/include/can_protocols/fault_can_protocol.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,15 @@ typedef enum
4444
*/
4545
typedef struct
4646
{
47-
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
48-
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
49-
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
47+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
48+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
49+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
5050

51-
uint32_t fault_origin_id; /* ID of the module that is sending out the fault. */
51+
uint32_t fault_origin_id; /*!< ID of the module that is sending out the fault. */
5252

53-
uint8_t reserved[2]; /* Reserved */
53+
uint8_t dtcs; /*!< DTC bitfield of the module that is sending out the fault. */
54+
55+
uint8_t reserved; /*!< Reserved */
5456
} oscc_fault_report_s;
5557

5658
#pragma pack(pop)

api/include/can_protocols/steering_can_protocol.h

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@
1313
#include "magic.h"
1414

1515

16+
/*
17+
* @brief Steering enable message (CAN frame) ID.
18+
*
19+
*/
20+
#define OSCC_STEERING_ENABLE_CAN_ID (0x54)
21+
22+
/*
23+
* @brief Steering disable message (CAN frame) ID.
24+
*
25+
*/
26+
#define OSCC_STEERING_DISABLE_CAN_ID (0x55)
27+
1628
/*
1729
* @brief Steering command message (CAN frame) ID.
1830
*
@@ -43,10 +55,48 @@
4355
*/
4456
#define OSCC_STEERING_DTC_INVALID_SENSOR_VAL (0x0)
4557

58+
/*
59+
* @brief Steering DTC bitfield position indicating an operator override.
60+
*
61+
*/
62+
#define OSCC_STEERING_DTC_OPERATOR_OVERRIDE (0x1)
63+
4664

4765
#pragma pack(push)
4866
#pragma pack(1)
4967

68+
/**
69+
* @brief Steering enable message.
70+
*
71+
* CAN frame ID: \ref OSCC_STEERING_ENABLE_CAN_ID
72+
*
73+
*/
74+
typedef struct
75+
{
76+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
77+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
78+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
79+
80+
uint8_t reserved[6]; /*!< Reserved. */
81+
} oscc_steering_enable_s;
82+
83+
84+
/**
85+
* @brief Steering disable message.
86+
*
87+
* CAN frame ID: \ref OSCC_STEERING_DISABLE_CAN_ID
88+
*
89+
*/
90+
typedef struct
91+
{
92+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
93+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
94+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
95+
96+
uint8_t reserved[6]; /*!< Reserved. */
97+
} oscc_steering_disable_s;
98+
99+
50100
/**
51101
* @brief Steering command message data.
52102
*
@@ -55,19 +105,15 @@
55105
*/
56106
typedef struct
57107
{
58-
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
59-
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
60-
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
108+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
109+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
110+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
61111

62112
uint16_t spoof_value_low; /*!< Value to be sent on the low spoof signal. */
63113

64114
uint16_t spoof_value_high; /*!< Value to be sent on the high spoof signal. */
65115

66-
uint8_t enable; /*!< Command to enable or disable steering control.
67-
* Zero value means disable.
68-
* Non-zero value means enable. */
69-
70-
uint8_t reserved; /*!< Reserved. */
116+
uint8_t reserved[2]; /*!< Reserved. */
71117
} oscc_steering_command_s;
72118

73119

@@ -79,9 +125,9 @@ typedef struct
79125
*/
80126
typedef struct
81127
{
82-
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
83-
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
84-
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
128+
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
129+
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
130+
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
85131

86132
uint8_t enabled; /*!< Steering controls enabled state.
87133
* Zero value means disabled (commands are ignored).
@@ -92,7 +138,7 @@ typedef struct
92138
* Non-zero value means an operator has physically overridden
93139
* the system. */
94140

95-
uint8_t dtcs; /* Bitfield of DTCs present in the module. */
141+
uint8_t dtcs; /*!< Bitfield of DTCs present in the module. */
96142

97143
uint8_t reserved[3]; /*!< Reserved. */
98144
} oscc_steering_report_s;

0 commit comments

Comments
 (0)