Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
vertexmachina committed Sep 21, 2017
2 parents dff841e + ea8e2c5 commit e4e4a8a
Show file tree
Hide file tree
Showing 147 changed files with 57,703 additions and 19,529 deletions.
11 changes: 11 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -76,6 +76,11 @@ Below is a sample of how additional vehicle directories should be created.

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

## System Acceptance Testing

Expand Down
34 changes: 21 additions & 13 deletions Jenkinsfile
Expand Up @@ -10,24 +10,32 @@ node('arduino') {
])
}
stage('Build') {
parallel 'kia soul firmware': {
sh 'cd firmware && mkdir build && cd build && cmake .. -DKIA_SOUL=ON -DCMAKE_BUILD_TYPE=Release && make'
parallel 'kia soul petrol firmware': {
sh 'cd firmware && mkdir build_kia_soul_petrol && cd build_kia_soul_petrol && cmake .. -DKIA_SOUL=ON -DCMAKE_BUILD_TYPE=Release && make'
}, 'kia soul EV firmware': {
sh 'cd firmware && mkdir build_kia_soul_ev && cd build_kia_soul_ev && cmake .. -DKIA_SOUL_EV=ON -DCMAKE_BUILD_TYPE=Release && make'
}
echo 'Build Complete!'
}
stage('Test') {
parallel 'unit tests': {
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'
echo 'Unit Tests Complete!'
}, 'property-based tests': {
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'
echo 'Property-Based Tests Complete!'
}, 'acceptance tests': {
echo 'Acceptance Tests Complete!'
stage('Kia Soul Petrol Tests') {
parallel 'kia soul petrol unit tests': {
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!'
}
echo 'Kia Soul Petrol Tests Complete!'
}
stage('Release') {
echo 'Release Package Created!'
stage('Kia Soul EV Tests') {
parallel 'kia soul ev unit tests': {
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!'
}
echo 'Kia Soul EV Tests Complete!'
}
}
catch(Exception e) {
Expand Down
306 changes: 154 additions & 152 deletions README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions api/OsccConfig.cmake
@@ -0,0 +1,7 @@
if(KIA_SOUL)
add_definitions(-DKIA_SOUL)
elseif(KIA_SOUL_EV)
add_definitions(-DKIA_SOUL_EV)
else()
message(FATAL_ERROR "No platform selected")
endif()
76 changes: 65 additions & 11 deletions api/include/can_protocols/brake_can_protocol.h
Expand Up @@ -13,6 +13,18 @@
#include "magic.h"


/*
* @brief Brake enable message (CAN frame) ID.
*
*/
#define OSCC_BRAKE_ENABLE_CAN_ID (0x50)

/*
* @brief Brake disable message (CAN frame) ID.
*
*/
#define OSCC_BRAKE_DISABLE_CAN_ID (0x51)

/*
* @brief Brake command message (CAN frame) ID.
*
Expand Down Expand Up @@ -43,10 +55,48 @@
*/
#define OSCC_BRAKE_DTC_INVALID_SENSOR_VAL (0x0)

/*
* @brief Brake DTC bitfield position indicating an operator override.
*
*/
#define OSCC_BRAKE_DTC_OPERATOR_OVERRIDE (0x1)


#pragma pack(push)
#pragma pack(1)

/**
* @brief Brake enable message.
*
* CAN frame ID: \ref OSCC_BRAKE_ENABLE_CAN_ID
*
*/
typedef struct
{
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

uint8_t reserved[6]; /*!< Reserved. */
} oscc_brake_enable_s;


/**
* @brief Brake disable message.
*
* CAN frame ID: \ref OSCC_BRAKE_DISABLE_CAN_ID
*
*/
typedef struct
{
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

uint8_t reserved[6]; /*!< Reserved. */
} oscc_brake_disable_s;


/**
* @brief Brake command message data.
*
Expand All @@ -55,17 +105,21 @@
*/
typedef struct
{
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

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

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

uint8_t reserved[3]; /*!< Reserved. */
uint16_t spoof_value_high; /*!< Value to be sent on the high spoof signal. */

uint8_t reserved[2]; /*!< Reserved. */
#endif
} oscc_brake_command_s;


Expand All @@ -77,9 +131,9 @@ typedef struct
*/
typedef struct
{
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

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

uint8_t dtcs; /* Bitfield of DTCs present in the module. */
uint8_t dtcs; /*!< Bitfield of DTCs present in the module. */

uint8_t reserved[3]; /*!< Reserved. */
} oscc_brake_report_s;
Expand Down
12 changes: 7 additions & 5 deletions api/include/can_protocols/fault_can_protocol.h
Expand Up @@ -44,13 +44,15 @@ typedef enum
*/
typedef struct
{
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

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

uint8_t reserved[2]; /* Reserved */
uint8_t dtcs; /*!< DTC bitfield of the module that is sending out the fault. */

uint8_t reserved; /*!< Reserved */
} oscc_fault_report_s;

#pragma pack(pop)
Expand Down
70 changes: 58 additions & 12 deletions api/include/can_protocols/steering_can_protocol.h
Expand Up @@ -13,6 +13,18 @@
#include "magic.h"


/*
* @brief Steering enable message (CAN frame) ID.
*
*/
#define OSCC_STEERING_ENABLE_CAN_ID (0x54)

/*
* @brief Steering disable message (CAN frame) ID.
*
*/
#define OSCC_STEERING_DISABLE_CAN_ID (0x55)

/*
* @brief Steering command message (CAN frame) ID.
*
Expand Down Expand Up @@ -43,10 +55,48 @@
*/
#define OSCC_STEERING_DTC_INVALID_SENSOR_VAL (0x0)

/*
* @brief Steering DTC bitfield position indicating an operator override.
*
*/
#define OSCC_STEERING_DTC_OPERATOR_OVERRIDE (0x1)


#pragma pack(push)
#pragma pack(1)

/**
* @brief Steering enable message.
*
* CAN frame ID: \ref OSCC_STEERING_ENABLE_CAN_ID
*
*/
typedef struct
{
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

uint8_t reserved[6]; /*!< Reserved. */
} oscc_steering_enable_s;


/**
* @brief Steering disable message.
*
* CAN frame ID: \ref OSCC_STEERING_DISABLE_CAN_ID
*
*/
typedef struct
{
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

uint8_t reserved[6]; /*!< Reserved. */
} oscc_steering_disable_s;


/**
* @brief Steering command message data.
*
Expand All @@ -55,19 +105,15 @@
*/
typedef struct
{
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

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

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

uint8_t enable; /*!< Command to enable or disable steering control.
* Zero value means disable.
* Non-zero value means enable. */

uint8_t reserved; /*!< Reserved. */
uint8_t reserved[2]; /*!< Reserved. */
} oscc_steering_command_s;


Expand All @@ -79,9 +125,9 @@ typedef struct
*/
typedef struct
{
uint8_t magic[2]; /* Magic number identifying CAN frame as from OSCC.
Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */
uint8_t magic[2]; /*!< Magic number identifying CAN frame as from OSCC.
* Byte 0 should be \ref OSCC_MAGIC_BYTE_0.
* Byte 1 should be \ref OSCC_MAGIC_BYTE_1. */

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

uint8_t dtcs; /* Bitfield of DTCs present in the module. */
uint8_t dtcs; /*!< Bitfield of DTCs present in the module. */

uint8_t reserved[3]; /*!< Reserved. */
} oscc_steering_report_s;
Expand Down

0 comments on commit e4e4a8a

Please sign in to comment.