Skip to content

Commit c8792df

Browse files
committed
adding in CI job to check compilation of the shared types
1 parent 5281675 commit c8792df

4 files changed

Lines changed: 37 additions & 9 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Compile C++
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v3
11+
12+
- name: Install build tools
13+
run: sudo apt-get update && sudo apt-get install -y g++
14+
15+
- name: Compile main.cpp
16+
run: g++ -o main include/main.cpp

include/SharedFirmwareTypes.h

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -361,25 +361,30 @@ struct TorqueControllerMuxStatus_s
361361

362362

363363

364-
/// @brief Stores setpoints for a command to the Drivetrain, containing speed and torque setpoints for each motor. These setpoints are defined in the torque controllers cycled by the TC Muxer.
364+
/// @brief Stores setpoints for a command to the Drivetrain, containing speed setpoints and torque limits for each motor. These setpoints are defined in the torque controllers cycled by the TC Muxer.
365365
/// The Speeds unit is rpm and are the targeted speeds for each wheel of the car.
366366
/// The torques unit is nm and is the max torque requested from the inverter to reach such speeds.
367-
struct DrivetrainCommand_s
367+
struct DrivetrainSpeedCommand_s
368368
{
369369
veh_vec<speed_rpm> desired_speeds;
370370
veh_vec<torque_nm> torque_limits;
371371
};
372372

373+
struct DrivetrainTorqueCommand_s
374+
{
375+
veh_vec<torque_nm> torque_limits;
376+
veh_vec<torque_nm> torque_setpoints;
377+
};
373378

374-
struct StampedDrivetrainCommand_s
379+
struct StampedDrivetrainTorqueCommand_s
375380
{
376-
StampedVehVec<speed_rpm> desired_speeds;
377-
StampedVehVec<torque_nm> torque_limits;
381+
StampedVehVec<speed_rpm> torque_limits;
382+
StampedVehVec<torque_nm> torque_setpoints;
378383

379-
DrivetrainCommand_s get_command()
384+
DrivetrainTorqueCommand_s get_command()
380385
{
381-
return {.desired_speeds = desired_speeds.veh_vec_data,
382-
.torque_limits = torque_limits.veh_vec_data};
386+
return {.torque_limits= torque_limits.veh_vec_data,
387+
.torque_setpoints = torque_setpoints.veh_vec_data};
383388
}
384389
};
385390

@@ -566,7 +571,7 @@ struct VCRInterfaceData_s
566571
DashInputState_s dash_input_state = {};
567572
StampedACUCoreData_s stamped_acu_core_data = {};
568573
ACUAllDataType_s acu_all_data = {};
569-
StampedDrivetrainCommand_s latest_drivebrain_command = {};
574+
StampedDrivetrainTorqueCommand_s latest_drivebrain_command = {};
570575
};
571576

572577
struct VCRData_s

library.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"email": "justin@goliath.org"
1414
}
1515
],
16+
"exclude": "verify_compile.cpp",
1617
"frameworks": "*",
1718
"platforms": "*"
1819
}

verify_compile.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "include/SharedFirmwareTypes.h"
2+
3+
int main()
4+
{
5+
return 0;
6+
}

0 commit comments

Comments
 (0)