diff --git a/seat_car_controller/include/seat_car_controller.h b/seat_car_controller/include/seat_car_controller.h index d8671452860c51081a9022507c206eac18f073c3..1ad5209d0faf09f313bafa8acbdaa14846bf5c02 100644 --- a/seat_car_controller/include/seat_car_controller.h +++ b/seat_car_controller/include/seat_car_controller.h @@ -49,7 +49,7 @@ namespace seat_car_controller private: // action subscriber ros::Subscriber steering_sub; - void steering_callback(const std_msgs::Int16::ConstPtr& msg); + void steering_callback(const std_msgs::UInt8::ConstPtr& msg); ros::Subscriber speed_sub; void speed_callback(const std_msgs::Int16::ConstPtr& msg); ros::Subscriber imu_sub; diff --git a/seat_car_controller/include/seat_car_controller_impl.h b/seat_car_controller/include/seat_car_controller_impl.h index 67117828d89e4ff8e4f8eb3f6cf5cd47d21b8f30..a5b4a0e863fe7295dc9ea1adc559649a5c34d570 100644 --- a/seat_car_controller/include/seat_car_controller_impl.h +++ b/seat_car_controller/include/seat_car_controller_impl.h @@ -254,7 +254,7 @@ namespace seat_car_controller this->yaw_pub = root_nh.advertise<std_msgs::Float32>(this->yaw_topic,1); this->twist_pub = root_nh.advertise<geometry_msgs::Twist>(this->twist_topic,1); - this->steer_angle_pub = root_nh.advertise<std_msgs::UInt8>(this->steering_fb_topic,1); + this->steer_angle_pub = root_nh.advertise<std_msgs::UInt16>(this->steering_fb_topic,1); this->last_cmd_drive=0.0; this->last_cmd_steer=0.0; @@ -272,7 +272,7 @@ namespace seat_car_controller static double yaw=0.0; static double last_steer_angle=0.0; geometry_msgs::Twist twist_msg; - std_msgs::UInt8 steer_angle_msg; + std_msgs::UInt16 steer_angle_msg; steer_l_pos=this->joints_[0].getPosition(); steer_r_pos=this->joints_[1].getPosition(); @@ -362,7 +362,7 @@ namespace seat_car_controller } template <class HardwareInterface> - void SeatCarController<HardwareInterface>::steering_callback(const std_msgs::Int16::ConstPtr& msg) + void SeatCarController<HardwareInterface>::steering_callback(const std_msgs::UInt8::ConstPtr& msg) { double servo_angle=(msg->data-this->zero_steer_angle)*3.14159/180.0; double car_angle;