55 pacmod_msgs::SteerSystemCmd steer_msg;
58 steer_msg.ignore_overrides =
false;
62 steer_msg.clear_override =
true;
70 float speed_scale = 1.0;
71 bool speed_valid =
false;
72 float current_speed = 0.0;
87 steer_msg.command = (range_scale *
max_rot_rad) * msg->axes[
axes[steering_axis]];
94 pacmod_msgs::SystemCmdInt turn_signal_cmd_pub_msg;
97 turn_signal_cmd_pub_msg.ignore_overrides =
false;
101 turn_signal_cmd_pub_msg.clear_override =
true;
120 if(msg->axes[2] < -0.5)
151 pacmod_msgs::SystemCmdInt shift_cmd_pub_msg;
153 shift_cmd_pub_msg.ignore_overrides =
false;
157 shift_cmd_pub_msg.clear_override =
true;
166 pacmod_msgs::SystemCmdInt shift_cmd_pub_msg;
168 shift_cmd_pub_msg.ignore_overrides =
false;
172 shift_cmd_pub_msg.clear_override =
true;
181 pacmod_msgs::SystemCmdInt shift_cmd_pub_msg;
183 shift_cmd_pub_msg.ignore_overrides =
false;
187 shift_cmd_pub_msg.clear_override =
true;
196 pacmod_msgs::SystemCmdInt shift_cmd_pub_msg;
198 shift_cmd_pub_msg.ignore_overrides =
false;
202 shift_cmd_pub_msg.clear_override =
true;
212 pacmod_msgs::SystemCmdInt shift_cmd_pub_msg;
214 shift_cmd_pub_msg.ignore_overrides =
false;
218 shift_cmd_pub_msg.clear_override =
true;
227 pacmod_msgs::SystemCmdFloat accelerator_cmd_pub_msg;
230 accelerator_cmd_pub_msg.ignore_overrides =
false;
234 accelerator_cmd_pub_msg.clear_override =
true;
262 accelerator_cmd_pub_msg.command = 0;
282 accelerator_cmd_pub_msg.command = 0;
291 pacmod_msgs::SystemCmdFloat brake_msg;
294 brake_msg.ignore_overrides =
false;
298 brake_msg.clear_override =
true;
315 brake_msg.command = 0;
329 brake_msg.command = fmin(pow(brake_value, 3) * 2.0F - pow(brake_value, 2) * 1.5F + brake_value * 0.625F, 1.0F);
333 brake_msg.command = brake_value;
338 brake_msg.command = 0;
353 pacmod_msgs::SystemCmdInt headlight_cmd_pub_msg;
355 headlight_cmd_pub_msg.ignore_overrides =
false;
383 headlight_cmd_pub_msg.clear_override =
true;
396 pacmod_msgs::SystemCmdBool horn_cmd_pub_msg;
398 horn_cmd_pub_msg.ignore_overrides =
false;
402 horn_cmd_pub_msg.clear_override =
true;
405 horn_cmd_pub_msg.command = 1;
407 horn_cmd_pub_msg.command = 0;
414 pacmod_msgs::SystemCmdInt wiper_cmd_pub_msg;
416 wiper_cmd_pub_msg.ignore_overrides =
false;
430 wiper_cmd_pub_msg.clear_override =
true;
ros::Subscriber shift_sub
static GamepadType controller
static int last_shift_cmd
static const float ROT_RANGE_SCALER_LB
static double steering_max_speed
void publish(const boost::shared_ptr< M > &message) const
static pacmod_msgs::VehicleSpeedRpt::ConstPtr last_speed_rpt
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::Publisher headlight_cmd_pub
static const float AXES_MIN
void publish_lights_horn_wipers_message(const sensor_msgs::Joy::ConstPtr &msg)
static const float AXES_MAX
PublishControlBoardRev3()
static int headlight_state
void publish_accelerator_message(const sensor_msgs::Joy::ConstPtr &msg)
static std::mutex speed_mutex
static const float ACCEL_OFFSET
static const uint16_t BUTTON_DOWN
static void callback_pacmod_enable(const std_msgs::Bool::ConstPtr &msg)
ros::Subscriber enable_sub
static JoyAxis steering_axis
static const float STEER_OFFSET
static std::mutex turn_mutex
static std::unordered_map< JoyButton, int, EnumHash > btns
ros::Publisher steering_set_position_with_speed_limit_pub
static double brake_scale_val
static const float ACCEL_SCALE_FACTOR
std::vector< float > last_axes
void publish_turn_signal_message(const sensor_msgs::Joy::ConstPtr &msg)
void publish_steering_message(const sensor_msgs::Joy::ConstPtr &msg)
static const uint16_t WIPER_STATE_START_VALUE
static double accel_scale_val
ros::Publisher accelerator_cmd_pub
static std::mutex shift_mutex
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
ros::Publisher brake_set_position_pub
static double max_veh_speed
ros::Publisher turn_signal_cmd_pub
ros::Publisher wiper_cmd_pub
static bool headlight_state_change
static void callback_turn_rpt(const pacmod_msgs::SystemRptInt::ConstPtr &msg)
ros::Publisher shift_cmd_pub
static void callback_shift_rpt(const pacmod_msgs::SystemRptInt::ConstPtr &msg)
static const uint16_t HEADLIGHT_STATE_START_VALUE
static const uint16_t NUM_HEADLIGHT_STATES
static std::unordered_map< JoyAxis, int, EnumHash > axes
static float last_brake_cmd
void publish_shifting_message(const sensor_msgs::Joy::ConstPtr &msg)
ros::Publisher horn_cmd_pub
void publish_brake_message(const sensor_msgs::Joy::ConstPtr &msg)
static const float STEER_SCALE_FACTOR
static const uint16_t NUM_WIPER_STATES