36 #include <sensor_msgs/JointState.h> 37 #include <sensor_msgs/Imu.h> 38 #include <geometry_msgs/Twist.h> 39 #include <std_msgs/Float64.h> 41 #include <nav_msgs/Odometry.h> 42 #include <robotnik_msgs/set_mode.h> 43 #include <robotnik_msgs/get_mode.h> 44 #include <robotnik_msgs/set_odometry.h> 45 #include <robotnik_msgs/ptz.h> 49 #include "diagnostic_msgs/DiagnosticStatus.h" 56 #define PI 3.1415926535 57 #define SUMMIT_XL_MIN_COMMAND_REC_FREQ 5.0 58 #define SUMMIT_XL_MAX_COMMAND_REC_FREQ 150.0 60 #define SKID_STEERING 1 61 #define MECANUM_STEERING 2 63 #define SUMMIT_XL_WHEEL_DIAMETER 0.25 // Default wheel diameter 64 #define SUMMIT_XL_D_TRACKS_M 1.0 // default equivalent W distance (difference is due to slippage of skid steering) 65 #define SUMMIT_XL_WHEELBASE 0.446 // default real L distance forward to rear axis 66 #define SUMMIT_XL_TRACKWIDTH 0.408 // default real W distance from left wheels to right wheels 234 node_handle_(h), private_node_handle_(
"~"),
236 freq_diag_(
diagnostic_updater::FrequencyStatusParam(&desired_freq_, &desired_freq_, 0.05) ),
241 ROS_INFO(
"summit_xl_robot_control_node - Init ");
245 kinematic_modes_ = 1;
247 ros::NodeHandle summit_xl_robot_control_node_handle(node_handle_,
"summit_xl_robot_control");
250 if (!private_node_handle_.
getParam(
"model", robot_model_)) {
254 else ROS_INFO(
"Robot Model : %s", robot_model_.c_str());
257 private_node_handle_.
param<std::string>(
"frw_vel_topic", frw_vel_topic_,
"/summit_xl/joint_frw_velocity_controller/command");
258 private_node_handle_.
param<std::string>(
"flw_vel_topic", flw_vel_topic_,
"/summit_xl/joint_flw_velocity_controller/command");
259 private_node_handle_.
param<std::string>(
"blw_vel_topic", blw_vel_topic_,
"/summit_xl/joint_blw_velocity_controller/command");
260 private_node_handle_.
param<std::string>(
"brw_vel_topic", brw_vel_topic_,
"/summit_xl/joint_brw_velocity_controller/command");
263 private_node_handle_.
param<std::string>(
"joint_front_right_wheel", joint_front_right_wheel,
"joint_front_right_wheel");
264 private_node_handle_.
param<std::string>(
"joint_front_left_wheel", joint_front_left_wheel,
"joint_front_left_wheel");
265 private_node_handle_.
param<std::string>(
"joint_back_left_wheel", joint_back_left_wheel,
"joint_back_left_wheel");
266 private_node_handle_.
param<std::string>(
"joint_back_right_wheel", joint_back_right_wheel,
"joint_back_right_wheel");
269 if ((robot_model_==
"summit_xl_omni") || (robot_model_==
"x_wam")) {
270 kinematic_modes_ = 2;
271 private_node_handle_.
param<std::string>(
"frw_pos_topic", frw_pos_topic_,
"/summit_xl/joint_frw_velocity_controller/command");
272 private_node_handle_.
param<std::string>(
"flw_pos_topic", flw_pos_topic_,
"/summit_xl/joint_flw_velocity_controller/command");
273 private_node_handle_.
param<std::string>(
"blw_pos_topic", blw_pos_topic_,
"/summit_xl/joint_blw_velocity_controller/command");
274 private_node_handle_.
param<std::string>(
"brw_pos_topic", brw_pos_topic_,
"/summit_xl/joint_brw_velocity_controller/command");
276 private_node_handle_.
param<std::string>(
"joint_front_right_steer", joint_front_right_steer,
"joint_front_right_steer");
277 private_node_handle_.
param<std::string>(
"joint_front_left_steer", joint_front_left_steer,
"joint_front_left_steer");
278 private_node_handle_.
param<std::string>(
"joint_back_left_steer", joint_back_left_steer,
"joint_back_left_steer");
279 private_node_handle_.
param<std::string>(
"joint_back_right_steer", joint_back_right_steer,
"joint_back_right_steer");
281 if (!private_node_handle_.
getParam(
"summit_xl_wheelbase", summit_xl_wheelbase_))
283 if (!private_node_handle_.
getParam(
"summit_xl_trackwidth", summit_xl_trackwidth_))
287 if (robot_model_==
"x_wam") {
288 private_node_handle_.
param<std::string>(
"scissor_pos_topic", scissor_pos_topic_,
"/summit_xl/joint_scissor_position_controller/command");
289 private_node_handle_.
param<std::string>(
"scissor_prismatic_joint", scissor_prismatic_joint,
"scissor_prismatic_joint");
294 private_node_handle_.
param<std::string>(
"pan_pos_topic", pan_pos_topic_,
"/summit_xl/joint_pan_position_controller/command");
295 private_node_handle_.
param<std::string>(
"tilt_pos_topic", tilt_pos_topic_,
"/summit_xl/joint_tilt_position_controller/command");
296 private_node_handle_.
param<std::string>(
"joint_camera_pan", joint_camera_pan,
"joint_camera_pan");
297 private_node_handle_.
param<std::string>(
"joint_camera_tilt", joint_camera_tilt,
"joint_camera_tilt");
300 private_node_handle_.
param<std::string>(
"odom_topic", odom_topic_,
"/summit_xl/odom_robot_control");
303 if (!private_node_handle_.
getParam(
"summit_xl_wheel_diameter", summit_xl_wheel_diameter_))
305 if (!private_node_handle_.
getParam(
"summit_xl_d_tracks_m", summit_xl_d_tracks_m_))
307 ROS_INFO(
"summit_xl_wheel_diameter_ = %5.2f", summit_xl_wheel_diameter_);
308 ROS_INFO(
"summit_xl_d_tracks_m_ = %5.2f", summit_xl_d_tracks_m_);
310 private_node_handle_.
param(
"publish_odom_tf", publish_odom_tf_,
true);
311 if (publish_odom_tf_)
ROS_INFO(
"PUBLISHING odom->base_footprin tf");
312 else ROS_INFO(
"NOT PUBLISHING odom->base_footprint tf");
315 linearSpeedXMps_ = 0.0;
316 linearSpeedYMps_ = 0.0;
317 angularSpeedRads_ = 0.0;
320 robot_pose_px_ = 0.0;
321 robot_pose_py_ = 0.0;
322 robot_pose_pa_ = 0.0;
323 robot_pose_vx_ = 0.0;
324 robot_pose_vy_ = 0.0;
335 ang_vel_x_ = 0.0; ang_vel_y_ = 0.0; ang_vel_z_ = 0.0;
336 lin_acc_x_ = 0.0; lin_acc_y_ = 0.0; lin_acc_z_ = 0.0;
337 orientation_x_ = 0.0; orientation_y_ = 0.0; orientation_z_ = 0.0; orientation_w_ = 0.0;
356 ref_vel_frw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( frw_vel_topic_, 50);
357 ref_vel_flw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( flw_vel_topic_, 50);
358 ref_vel_blw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( blw_vel_topic_, 50);
359 ref_vel_brw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( brw_vel_topic_, 50);
361 if ((robot_model_==
"summit_xl_omni")||(robot_model_==
"x_wam")) {
362 ref_pos_frw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( frw_pos_topic_, 50);
363 ref_pos_flw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( flw_pos_topic_, 50);
364 ref_pos_blw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( blw_pos_topic_, 50);
365 ref_pos_brw_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( brw_pos_topic_, 50);
367 if (robot_model_==
"x_wam")
368 ref_pos_scissor_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( scissor_pos_topic_, 50);
371 ref_pos_pan_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( pan_pos_topic_, 50);
372 ref_pos_tilt_ = summit_xl_robot_control_node_handle.
advertise<std_msgs::Float64>( tilt_pos_topic_, 50);
382 odom_pub_ = summit_xl_robot_control_node_handle.
advertise<nav_msgs::Odometry>(odom_topic_, 1000);
385 diagnostic_.
setHardwareID(
"summit_xl_robot_control - simulation");
386 diagnostic_.
add( freq_diag_ );
387 diagnostic_.
add( command_freq_ );
395 subs_command_freq->
addTask(&command_freq_);
405 ROS_INFO(
"SummitXLControllerClass::starting");
413 vector<string> joint_names = joint_state_.name;
414 frw_vel_ = find (joint_names.begin(),joint_names.end(), string(joint_front_right_wheel)) - joint_names.begin();
415 flw_vel_ = find (joint_names.begin(),joint_names.end(), string(joint_front_left_wheel)) - joint_names.begin();
416 blw_vel_ = find (joint_names.begin(),joint_names.end(), string(joint_back_left_wheel)) - joint_names.begin();
417 brw_vel_ = find (joint_names.begin(),joint_names.end(), string(joint_back_right_wheel)) - joint_names.begin();
418 if ((robot_model_==
"summit_xl_omni")||(robot_model_==
"x_wam")) {
419 frw_pos_ = find (joint_names.begin(),joint_names.end(), string(joint_front_right_steer)) - joint_names.begin();
420 flw_pos_ = find (joint_names.begin(),joint_names.end(), string(joint_front_left_steer)) - joint_names.begin();
421 blw_pos_ = find (joint_names.begin(),joint_names.end(), string(joint_back_left_steer)) - joint_names.begin();
422 brw_pos_ = find (joint_names.begin(),joint_names.end(), string(joint_back_right_steer)) - joint_names.begin();
424 if (robot_model_==
"x_wam") {
425 scissor_pos_ = find (joint_names.begin(),joint_names.end(), string(scissor_prismatic_joint)) - joint_names.begin();
442 double v_left_mps, v_right_mps;
445 v_left_mps = ((joint_state_.velocity[blw_vel_] + joint_state_.velocity[flw_vel_]) / 2.0) * (summit_xl_wheel_diameter_ / 2.0);
446 v_right_mps = -((joint_state_.velocity[brw_vel_] + joint_state_.velocity[frw_vel_]) / 2.0) * (summit_xl_wheel_diameter_ / 2.0);
449 linearSpeedXMps_ = (v_right_mps + v_left_mps) / 2.0;
450 angularSpeedRads_ = (v_right_mps - v_left_mps) / summit_xl_d_tracks_m_;
458 static double epvant =0.0;
459 static double epwant =0.0;
465 double kpv=2.5;
double kdv=0.0;
466 double kpw=25.0;
double kdw=15.0;
469 epv = v_ref_x_ - linearSpeedXMps_;
470 epw = w_ref_ - angularSpeedRads_;
474 double uv= kpv * epv + kdv * (epv - epvant);
475 double uw= kpw * epw + kdw * (epw - epwant);
480 double dUl = uv - 0.5 * summit_xl_d_tracks_m_ * uw;
482 double dUr = -(uv + 0.5 * summit_xl_d_tracks_m_ * uw);
490 std_msgs::Float64 frw_ref_msg;
491 std_msgs::Float64 flw_ref_msg;
492 std_msgs::Float64 blw_ref_msg;
493 std_msgs::Float64 brw_ref_msg;
496 frw_ref_msg.data = saturation( k1 * dUr, -limit, limit);
497 flw_ref_msg.data = saturation( k1 * dUl, -limit, limit);
498 blw_ref_msg.data = saturation( k1 * dUl, -limit, limit);
499 brw_ref_msg.data = saturation( k1 * dUr, -limit, limit);
501 ref_vel_frw_.
publish( frw_ref_msg );
502 ref_vel_flw_.
publish( flw_ref_msg );
503 ref_vel_blw_.
publish( blw_ref_msg );
504 ref_vel_brw_.
publish( brw_ref_msg );
513 double v_frw_mps, v_flw_mps, v_blw_mps, v_brw_mps;
514 v_frw_mps = joint_state_.velocity[frw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
515 v_flw_mps = joint_state_.velocity[flw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
516 v_blw_mps = joint_state_.velocity[blw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
517 v_brw_mps = joint_state_.velocity[brw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
519 double vx = v_ref_x_;
520 double vy = v_ref_y_;
522 double L = summit_xl_wheelbase_;
523 double W = summit_xl_trackwidth_;
526 double x1 = L/2.0;
double y1 = - W/2.0;
527 double wx1 = v_ref_x_ - w_ref_ * y1;
528 double wy1 = v_ref_y_ + w_ref_ * x1;
529 double q1 = -sqrt( wx1*wx1 + wy1*wy1 );
530 double a1 = radnorm( atan2( wy1, wx1 ) );
531 double x2 = L/2.0;
double y2 = W/2.0;
532 double wx2 = v_ref_x_ - w_ref_ * y2;
533 double wy2 = v_ref_y_ + w_ref_ * x2;
534 double q2 = sqrt( wx2*wx2 + wy2*wy2 );
535 double a2 = radnorm( atan2( wy2, wx2 ) );
536 double x3 = -L/2.0;
double y3 = W/2.0;
537 double wx3 = v_ref_x_ - w_ref_ * y3;
538 double wy3 = v_ref_y_ + w_ref_ * x3;
539 double q3 = sqrt( wx3*wx3 + wy3*wy3 );
540 double a3 = radnorm( atan2( wy3, wx3 ) );
541 double x4 = -L/2.0;
double y4 = -W/2.0;
542 double wx4 = v_ref_x_ - w_ref_ * y4;
543 double wy4 = v_ref_y_ + w_ref_ * x4;
544 double q4 = -sqrt( wx4*wx4 + wy4*wy4 );
545 double a4 = radnorm( atan2( wy4, wx4 ) );
553 std_msgs::Float64 frw_ref_vel_msg;
554 std_msgs::Float64 flw_ref_vel_msg;
555 std_msgs::Float64 blw_ref_vel_msg;
556 std_msgs::Float64 brw_ref_vel_msg;
557 frw_ref_vel_msg.data = saturation(-1.0 * (joint_state_.velocity[frw_vel_] - q1), -limit, limit);
558 flw_ref_vel_msg.data = saturation(-1.0 * (joint_state_.velocity[flw_vel_] - q2), -limit, limit);
559 blw_ref_vel_msg.data = saturation(-1.0 * (joint_state_.velocity[blw_vel_] - q3), -limit, limit);
560 brw_ref_vel_msg.data = saturation(-1.0 * (joint_state_.velocity[brw_vel_] - q4), -limit, limit);
561 ref_vel_frw_.
publish( frw_ref_vel_msg );
562 ref_vel_flw_.
publish( flw_ref_vel_msg );
563 ref_vel_blw_.
publish( blw_ref_vel_msg );
564 ref_vel_brw_.
publish( brw_ref_vel_msg );
565 std_msgs::Float64 frw_ref_pos_msg;
566 std_msgs::Float64 flw_ref_pos_msg;
567 std_msgs::Float64 blw_ref_pos_msg;
568 std_msgs::Float64 brw_ref_pos_msg;
569 frw_ref_pos_msg.data = a1;
570 flw_ref_pos_msg.data = a2;
571 blw_ref_pos_msg.data = a3;
572 brw_ref_pos_msg.data = a4;
574 ref_pos_frw_.
publish( frw_ref_pos_msg);
575 ref_pos_flw_.
publish( flw_ref_pos_msg);
576 ref_pos_blw_.
publish( blw_ref_pos_msg);
577 ref_pos_brw_.
publish( brw_ref_pos_msg);
582 if (robot_model_ ==
"x_wam") {
584 static double scissor_ref_pos = 0.0;
585 scissor_ref_pos += (v_ref_z_ / desired_freq_);
586 std_msgs::Float64 scissor_ref_pos_msg;
588 scissor_ref_pos_msg.data = saturation(scissor_ref_pos, 0.0, 0.5);
589 ref_pos_scissor_.
publish( scissor_ref_pos_msg );
593 std_msgs::Float64 pan_ref_pos_msg, tilt_ref_pos_msg;
594 pan_ref_pos_msg.data = pos_ref_pan_;
595 ref_pos_pan_.
publish( pan_ref_pos_msg );
596 tilt_ref_pos_msg.data = pos_ref_tilt_;
597 ref_pos_tilt_.
publish( tilt_ref_pos_msg );
607 robot_pose_vx_ = linearSpeedXMps_ * cos(robot_pose_pa_);
608 robot_pose_vy_ = linearSpeedXMps_ * sin(robot_pose_pa_);
615 double v1, v2, v3, v4;
616 v1 = joint_state_.velocity[frw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
617 v2 = joint_state_.velocity[flw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
618 v3 = joint_state_.velocity[blw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
619 v4 = joint_state_.velocity[brw_vel_] * (summit_xl_wheel_diameter_ / 2.0);
620 double a1, a2, a3, a4;
621 a1 = radnorm2( joint_state_.position[frw_pos_] );
622 a2 = radnorm2( joint_state_.position[flw_pos_] );
623 a3 = radnorm2( joint_state_.position[blw_pos_] );
624 a4 = radnorm2( joint_state_.position[brw_pos_] );
625 double v1x = -v1 * cos( a1 );
double v1y = -v1 * sin( a1 );
626 double v2x = v2 * cos( a2 );
double v2y = v2 * sin( a2 );
627 double v3x = v3 * cos( a3 );
double v3y = v3 * sin( a3 );
628 double v4x = -v4 * cos( a4 );
double v4y = -v4 * sin( a4 );
629 double C = (v4y + v1y) / 2.0;
630 double B = (v2x + v1x) / 2.0;
631 double D = (v2y + v3y) / 2.0;
632 double A = (v3x + v4x) / 2.0;
634 robot_pose_vx_ = (A+B) / 2.0;
635 robot_pose_vy_ = (C+D) / 2.0;
639 double fSamplePeriod = 1.0 / desired_freq_;
640 robot_pose_pa_ += ang_vel_z_ * fSamplePeriod;
641 robot_pose_px_ += robot_pose_vx_ * fSamplePeriod;
642 robot_pose_py_ += robot_pose_vy_ * fSamplePeriod;
652 geometry_msgs::TransformStamped odom_trans;
653 odom_trans.header.stamp = current_time;
654 odom_trans.header.frame_id =
"odom";
655 odom_trans.child_frame_id =
"base_footprint";
657 odom_trans.transform.translation.x = robot_pose_px_;
658 odom_trans.transform.translation.y = robot_pose_py_;
659 odom_trans.transform.translation.z = 0.0;
660 odom_trans.transform.rotation.x = orientation_x_;
661 odom_trans.transform.rotation.y = orientation_y_;
662 odom_trans.transform.rotation.z = orientation_z_;
663 odom_trans.transform.rotation.w = orientation_w_;
668 if (publish_odom_tf_) odom_broadcaster.
sendTransform(odom_trans);
671 nav_msgs::Odometry odom;
672 odom.header.stamp = current_time;
673 odom.header.frame_id =
"odom";
677 odom.pose.pose.position.x = robot_pose_px_;
678 odom.pose.pose.position.y = robot_pose_py_;
679 odom.pose.pose.position.z = 0.0;
681 odom.pose.pose.orientation.x = orientation_x_;
682 odom.pose.pose.orientation.y = orientation_y_;
683 odom.pose.pose.orientation.z = orientation_z_;
684 odom.pose.pose.orientation.w = orientation_w_;
686 for(
int i = 0; i < 6; i++)
687 odom.pose.covariance[i*6+i] = 0.1;
690 odom.child_frame_id =
"base_footprint";
692 odom.twist.twist.linear.x = robot_pose_vx_;
693 odom.twist.twist.linear.y = robot_pose_vy_;
694 odom.twist.twist.linear.z = 0.0;
696 odom.twist.twist.angular.x = ang_vel_x_;
697 odom.twist.twist.angular.y = ang_vel_y_;
698 odom.twist.twist.angular.z = ang_vel_z_;
700 for(
int i = 0; i < 6; i++)
701 odom.twist.covariance[6*i+i] = 0.1;
720 double diff = (current_time - last_command_time_).toSec();
723 stat.
summary(diagnostic_msgs::DiagnosticStatus::WARN,
"Topic is not receiving commands");
727 stat.
summary(diagnostic_msgs::DiagnosticStatus::OK,
"Topic receiving commands");
735 v_ref_x_ = saturation(cmd_vel.linear.x, -10.0, 10.0);
736 v_ref_y_ = saturation(cmd_vel.linear.y, -10.0, 10.0);
737 w_ref_ = saturation(cmd_vel.angular.z, -10.0, 10.0);
738 v_ref_z_ = saturation(cmd_vel.linear.z, -10.0, 10.0);
743 bool srvCallback_SetMode(robotnik_msgs::set_mode::Request& request, robotnik_msgs::set_mode::Response& response)
750 ROS_INFO(
"SummitXLControllerClass::srvCallback_SetMode request.mode= %d", request.mode);
751 if (request.mode == 1) {
752 active_kinematic_mode_ = request.mode;
755 if (request.mode == 2) {
756 if (kinematic_modes_ == 2) {
757 active_kinematic_mode_ = request.mode;
766 bool srvCallback_GetMode(robotnik_msgs::get_mode::Request& request, robotnik_msgs::get_mode::Response& response)
768 response.mode = active_kinematic_mode_;
798 subs_command_freq->
tick();
800 base_vel_msg_ = *msg;
801 this->setCommand(base_vel_msg_);
807 pos_ref_pan_ += msg->pan / 180.0 *
PI;
808 pos_ref_tilt_ += msg->tilt / 180.0 *
PI;
814 orientation_x_ = imu_msg.orientation.x;
815 orientation_y_ = imu_msg.orientation.y;
816 orientation_z_ = imu_msg.orientation.z;
817 orientation_w_ = imu_msg.orientation.w;
819 ang_vel_x_ = imu_msg.angular_velocity.x;
820 ang_vel_y_ = imu_msg.angular_velocity.y;
821 ang_vel_z_ = imu_msg.angular_velocity.z;
823 lin_acc_x_ = imu_msg.linear_acceleration.x;
824 lin_acc_y_ = imu_msg.linear_acceleration.y;
825 lin_acc_z_ = imu_msg.linear_acceleration.z;
837 while (value >
PI) value -=
PI;
838 while (value < -
PI) value +=
PI;
844 while (value > 2.0*
PI) value -= 2.0*
PI;
845 while (value < -2.0*
PI) value += 2.0*
PI;
851 ROS_INFO(
"summit_xl_robot_control::spin()");
875 ROS_INFO(
"summit_xl_robot_control::spin() - end");
881 int main(
int argc,
char** argv)
883 ros::init(argc, argv,
"summit_xl_robot_control");
int main(int argc, char **argv)
SummitXLControllerClass(ros::NodeHandle h)
double summit_xl_d_tracks_m_
std::string scissor_prismatic_joint
double radnorm(double value)
#define SUMMIT_XL_MAX_COMMAND_REC_FREQ
ros::Publisher ref_pos_tilt_
ros::NodeHandle node_handle_
std::string blw_pos_topic_
void publish(const boost::shared_ptr< M > &message) const
std::string joint_front_left_wheel
void check_command_subscriber(diagnostic_updater::DiagnosticStatusWrapper &stat)
double summit_xl_wheelbase_
#define SUMMIT_XL_WHEELBASE
void summary(unsigned char lvl, const std::string s)
std::string joint_back_left_wheel
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
tf::TransformBroadcaster odom_broadcaster
std::string scissor_pos_topic_
void setHardwareID(const std::string &hwid)
ros::Time last_command_time_
void jointStateCallback(const sensor_msgs::JointStateConstPtr &msg)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void imuCallback(const sensor_msgs::Imu &imu_msg)
void commandCallback(const geometry_msgs::TwistConstPtr &msg)
void add(const std::string &name, TaskFunction f)
int starting()
Controller startup in realtime.
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
ros::Publisher ref_vel_brw_
ros::Publisher ref_pos_blw_
double saturation(double u, double min, double max)
bool srvCallback_SetOdometry(robotnik_msgs::set_odometry::Request &request, robotnik_msgs::set_odometry::Response &response)
#define SUMMIT_XL_MIN_COMMAND_REC_FREQ
bool srvCallback_SetMode(robotnik_msgs::set_mode::Request &request, robotnik_msgs::set_mode::Response &response)
std::string joint_front_left_steer
double radnorm2(double value)
void command_ptzCallback(const robotnik_msgs::ptzConstPtr &msg)
diagnostic_updater::FunctionDiagnosticTask command_freq_
ros::Subscriber joint_state_sub_
ros::Publisher ref_vel_blw_
double summit_xl_trackwidth_
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void UpdateControl()
Controller update loop.
geometry_msgs::Twist base_vel_msg_
bool srvCallback_GetMode(robotnik_msgs::get_mode::Request &request, robotnik_msgs::get_mode::Response &response)
std::string brw_vel_topic_
ros::NodeHandle private_node_handle_
ROSCPP_DECL bool isShuttingDown()
ros::ServiceServer srv_SetMode_
double summit_xl_wheel_diameter_
#define SUMMIT_XL_TRACKWIDTH
std::string frw_pos_topic_
void setCommand(const geometry_msgs::Twist &cmd_vel)
std::string blw_vel_topic_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
void stopping()
Controller stopping.
std::string joint_back_right_wheel
std::string joint_camera_tilt
ros::Publisher ref_pos_flw_
diagnostic_updater::HeaderlessTopicDiagnostic * subs_command_freq
std::string joint_camera_pan
ros::Publisher ref_pos_scissor_
ros::Publisher ref_vel_frw_
TFSIMD_FORCE_INLINE const tfScalar & w() const
ros::ServiceServer srv_SetOdometry_
std::string frw_vel_topic_
std::string brw_pos_topic_
std::string pan_pos_topic_
sensor_msgs::JointState joint_state_
bool getParam(const std::string &key, std::string &s) const
std::string joint_back_left_steer
ros::ServiceServer srv_GetMode_
int active_kinematic_mode_
diagnostic_updater::FrequencyStatus freq_diag_
std::string joint_front_right_steer
std::string flw_pos_topic_
#define SUMMIT_XL_WHEEL_DIAMETER
ros::Publisher ref_pos_pan_
ROSCPP_DECL void spinOnce()
std::string tilt_pos_topic_
ros::Publisher ref_vel_flw_
diagnostic_updater::Updater diagnostic_
std::string joint_back_right_steer
ros::Publisher ref_pos_frw_
#define SUMMIT_XL_D_TRACKS_M
ros::Publisher ref_pos_brw_
std::string joint_front_right_wheel
std::string flw_vel_topic_
void addTask(DiagnosticTask *t)