@Pigmon
2019-07-24T16:30:22.000000Z
字数 723
阅读 1031
同力宽体车
增加消息:rc_ctrl_switch
msg
CMAKE
Header header
float64 lat_error
float64 lon_error
float64 angle_error
uint8 state
uint8 Normal = 0
uint8 RequiredRC = 1
uint8 Emergency = 2
struct DGram_Vehicle
int m_lat_error;
int m_lon_error;
int m_angle_error;
#include <vehicle_msgs/rc_ctrl_switch.h>
...
void switch_msg_callback(const vehicle_msgs::rc_ctrl_switch &msg);
...
ros::Subscriber subber_switch = nh.subscribe("rc_switch", 10, switch_msg_callback);
...
void switch_msg_callback(const vehicle_msgs::rc_ctrl_switch &msg)
{
G::vehicle_dgram.m_lat_error = (int)msg.lat_error * 100;
G::vehicle_dgram.m_lon_error = (int)msg.lon_error * 100;
G::vehicle_dgram.m_angle_error = (int)msg.angle_error * 100;
G::vehicle_dgram.m_ctrl_info = (short)msg.state;
}