Skip to content

Commit d9b0cf2

Browse files
committed
add some missing parse/pub_functions
1 parent 9e59f8f commit d9b0cf2

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

include/pacmod4/pacmod4_nodelet.h

-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108
#include <pacmod4_msgs/VehicleFaultRpt.h>
109109
#include <pacmod4_msgs/VehicleFaultRpt2.h>
110110
#include <pacmod4_msgs/VehicleSpeedRpt.h>
111-
#include <pacmod4_msgs/VinRpt.h>
112111
#include <pacmod4_msgs/WatchdogRpt.h>
113112
#include <pacmod4_msgs/WatchdogRpt2.h>
114113
#include <pacmod4_msgs/WheelSpeedRpt.h>
@@ -153,7 +152,6 @@ class Pacmod4Nl : public nodelet::Nodelet
153152
void initializeParkingBrakeRptApi();
154153
void initializeRearLightsRptApi();
155154
void initializeSteeringRpt2Api();
156-
void initializeVinRptApi();
157155
void initializeWheelSpeedApi(uint32_t can_id);
158156
void initializeWiperApi();
159157

src/pacmod4_nodelet.cpp

-11
Original file line numberDiff line numberDiff line change
@@ -408,12 +408,6 @@ void Pacmod4Nl::initializeSteeringRpt2Api()
408408
NODELET_INFO("Initialized Steering Rpt 2 API");
409409
}
410410

411-
void Pacmod4Nl::initializeVinRptApi()
412-
{
413-
pub_tx_list.emplace(VIN_RPT_CANID, nh_.advertise<pacmod4_msgs::VinRpt>("vin_rpt", 20));
414-
NODELET_INFO("Initialized VIN Rpt API");
415-
}
416-
417411
void Pacmod4Nl::initializeWheelSpeedApi(uint32_t can_id)
418412
{
419413
switch (can_id)
@@ -641,11 +635,6 @@ void Pacmod4Nl::initializeApiForMsg(uint32_t msg_can_id)
641635
initializeSteeringRpt2Api();
642636
break;
643637
}
644-
case VIN_RPT_CANID:
645-
{
646-
initializeVinRptApi();
647-
break;
648-
}
649638
case WHEEL_SPEED_RPT_CANID:
650639
case WHEEL_SPEED_RPT_2_CANID:
651640
{

src/pacmod4_ros_msg_handler.cpp

+28-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ Pacmod4RosMsgHandler::Pacmod4RosMsgHandler(uint32_t dbc_major_version)
7979
// Int Reports
8080
parse_functions[CRUISE_CONTROL_BUTTONS_RPT_CANID] =
8181
parse_functions[ENGINE_RPT_CANID] =
82-
parse_functions[ENGINE_BRAKE_RPT_CANID] =
8382
parse_functions[EXHAUST_BRAKE_RPT_CANID] =
8483
parse_functions[HEADLIGHT_RPT_CANID] =
8584
parse_functions[REAR_PASS_DOOR_RPT_CANID] =
@@ -88,7 +87,6 @@ Pacmod4RosMsgHandler::Pacmod4RosMsgHandler(uint32_t dbc_major_version)
8887
parse_functions[WIPER_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseSystemRptInt, std::ref(*msg_api_), std::placeholders::_1);
8988
pub_functions[CRUISE_CONTROL_BUTTONS_RPT_CANID] =
9089
pub_functions[ENGINE_RPT_CANID] =
91-
pub_functions[ENGINE_BRAKE_RPT_CANID] =
9290
pub_functions[EXHAUST_BRAKE_RPT_CANID] =
9391
pub_functions[HEADLIGHT_RPT_CANID] =
9492
pub_functions[REAR_PASS_DOOR_RPT_CANID] =
@@ -140,6 +138,14 @@ Pacmod4RosMsgHandler::Pacmod4RosMsgHandler(uint32_t dbc_major_version)
140138
pub_functions[TURN_AUX_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::TurnAuxRpt>, this, std::placeholders::_1, std::placeholders::_2);
141139
pub_functions[WIPER_AUX_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::WiperAuxRpt>, this, std::placeholders::_1, std::placeholders::_2);
142140

141+
// Command Limit Reports
142+
parse_functions[ACCEL_CMD_LIMIT_RPT_CANID] =
143+
parse_functions[BRAKE_CMD_LIMIT_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseCmdLimitRpt, std::ref(*msg_api_), std::placeholders::_1);
144+
parse_functions[STEERING_CMD_LIMIT_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseSteeringCmdLimitRpt, std::ref(*msg_api_), std::placeholders::_1);
145+
pub_functions[ACCEL_CMD_LIMIT_RPT_CANID] =
146+
pub_functions[BRAKE_CMD_LIMIT_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::SystemCmdLimitRpt>, this, std::placeholders::_1, std::placeholders::_2);
147+
pub_functions[STEERING_CMD_LIMIT_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::SteeringCmdLimitRpt>, this, std::placeholders::_1, std::placeholders::_2);
148+
143149
// Component Reports
144150
parse_functions[COMPONENT_RPT_00_CANID] =
145151
parse_functions[COMPONENT_RPT_01_CANID] =
@@ -177,25 +183,45 @@ Pacmod4RosMsgHandler::Pacmod4RosMsgHandler(uint32_t dbc_major_version)
177183

178184
// Other Reports
179185
parse_functions[AIR_PRESSURE_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseAirPressureRpt, std::ref(*msg_api_), std::placeholders::_1);
186+
parse_functions[ANG_VEL_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseAngVelRpt, std::ref(*msg_api_), std::placeholders::_1);
187+
parse_functions[AUTOMS_MAN_SWITCH_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseAutomsManSwitchRpt, std::ref(*msg_api_), std::placeholders::_1);
188+
parse_functions[BATTERY_VOLTAGE_LEVEL_RPT_1_CANID] =
189+
parse_functions[BATTERY_VOLTAGE_LEVEL_RPT_2_CANID] = std::bind(&pacmod4_common::DbcApi::ParseBatteryVoltageLevelRpt, std::ref(*msg_api_), std::placeholders::_1);
190+
parse_functions[CABIN_CLIMATE_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseCabinClimateRpt, std::ref(*msg_api_), std::placeholders::_1);
191+
parse_functions[DOOR_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseDoorRpt, std::ref(*msg_api_), std::placeholders::_1);
180192
parse_functions[DRIVE_TRAIN_FEATURE_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseDrivetrainFeatureRpt, std::ref(*msg_api_), std::placeholders::_1);
193+
parse_functions[ENGINE_BRAKE_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseEngineBrakeRpt, std::ref(*msg_api_), std::placeholders::_1);
181194
parse_functions[ESTOP_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseEStopRpt, std::ref(*msg_api_), std::placeholders::_1);
182195
parse_functions[ENGINE_LOAD_FACTOR_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseEngineLoadFactorRpt, std::ref(*msg_api_), std::placeholders::_1);
183196
parse_functions[GLOBAL_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseGlobalRpt, std::ref(*msg_api_), std::placeholders::_1);
184197
parse_functions[GLOBAL_RPT_2_CANID] = std::bind(&pacmod4_common::DbcApi::ParseGlobalRpt2, std::ref(*msg_api_), std::placeholders::_1);
198+
parse_functions[INTERIOR_LIGHTS_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseInteriorLightsRpt, std::ref(*msg_api_), std::placeholders::_1);
185199
parse_functions[NOTIFICATION_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseNotificationRpt, std::ref(*msg_api_), std::placeholders::_1);
200+
parse_functions[OCCUPANCY_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseOccupancyRpt, std::ref(*msg_api_), std::placeholders::_1);
201+
parse_functions[REAR_LIGHTS_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseRearLightsRpt, std::ref(*msg_api_), std::placeholders::_1);
186202
parse_functions[REMOTE_STOP_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseRemoteStopRpt, std::ref(*msg_api_), std::placeholders::_1);
187203
parse_functions[SAFETY_FUNC_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseSafetyFuncRpt, std::ref(*msg_api_), std::placeholders::_1);
188204
parse_functions[SAFETY_FUNC_RPT_2_CANID] = std::bind(&pacmod4_common::DbcApi::ParseSafetyFuncRpt2, std::ref(*msg_api_), std::placeholders::_1);
189205
parse_functions[WHEEL_SPEED_RPT_CANID] =
190206
parse_functions[WHEEL_SPEED_RPT_2_CANID] = std::bind(&pacmod4_common::DbcApi::ParseWheelSpeedRpt, std::ref(*msg_api_), std::placeholders::_1);
191207
parse_functions[VEHICLE_SPEED_RPT_CANID] = std::bind(&pacmod4_common::DbcApi::ParseVehicleSpeedRpt, std::ref(*msg_api_), std::placeholders::_1);
192208
pub_functions[AIR_PRESSURE_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::AirPressureRpt>, this, std::placeholders::_1, std::placeholders::_2);
209+
pub_functions[ANG_VEL_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::AngVelRpt>, this, std::placeholders::_1, std::placeholders::_2);
210+
pub_functions[AUTOMS_MAN_SWITCH_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::AutomsManSwitchRpt>, this, std::placeholders::_1, std::placeholders::_2);
211+
pub_functions[BATTERY_VOLTAGE_LEVEL_RPT_1_CANID] =
212+
pub_functions[BATTERY_VOLTAGE_LEVEL_RPT_2_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::BatteryVoltageLevelRpt>, this, std::placeholders::_1, std::placeholders::_2);
213+
pub_functions[CABIN_CLIMATE_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::CabinClimateRpt>, this, std::placeholders::_1, std::placeholders::_2);
193214
pub_functions[DRIVE_TRAIN_FEATURE_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::DrivetrainFeatureRpt>, this, std::placeholders::_1, std::placeholders::_2);
215+
pub_functions[DOOR_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::DoorRpt>, this, std::placeholders::_1, std::placeholders::_2);
216+
pub_functions[ENGINE_BRAKE_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::EngineBrakeRpt>, this, std::placeholders::_1, std::placeholders::_2);
194217
pub_functions[ESTOP_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::EStopRpt>, this, std::placeholders::_1, std::placeholders::_2);
195218
pub_functions[ENGINE_LOAD_FACTOR_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::EngineLoadFactorRpt>, this, std::placeholders::_1, std::placeholders::_2);
196219
pub_functions[GLOBAL_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::GlobalRpt>, this, std::placeholders::_1, std::placeholders::_2);
197220
pub_functions[GLOBAL_RPT_2_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::GlobalRpt2>, this, std::placeholders::_1, std::placeholders::_2);
221+
pub_functions[INTERIOR_LIGHTS_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::InteriorLightsRpt>, this, std::placeholders::_1, std::placeholders::_2);
198222
pub_functions[NOTIFICATION_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::NotificationRpt>, this, std::placeholders::_1, std::placeholders::_2);
223+
pub_functions[OCCUPANCY_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::OccupancyRpt>, this, std::placeholders::_1, std::placeholders::_2);
224+
pub_functions[REAR_LIGHTS_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::RearLightsRpt>, this, std::placeholders::_1, std::placeholders::_2);
199225
pub_functions[REMOTE_STOP_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::RemoteStopRpt>, this, std::placeholders::_1, std::placeholders::_2);
200226
pub_functions[SAFETY_FUNC_RPT_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::SafetyFuncRpt>, this, std::placeholders::_1, std::placeholders::_2);
201227
pub_functions[SAFETY_FUNC_RPT_2_CANID] = std::bind(&Pacmod4RosMsgHandler::ParseAndPublishType<pacmod4_msgs::SafetyFuncRpt2>, this, std::placeholders::_1, std::placeholders::_2);

0 commit comments

Comments
 (0)