ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I solved the problem. I put the if-else condition in the void callback function. Here is the code:
void Localization::callback(const ti_mmwave_rospkg::RadarScan::ConstPtr& msg) { id = msg->point_id;
if (id == 0){
r_a = msg->range;
theta_a = msg->bearing;
ROS_INFO("Range A is = %.2f", r_a);
ROS_INFO("Bearing A is = %.2f", theta_a);
}else if (id == 1){
r_b = msg->range;
theta_b = msg->bearing;
ROS_INFO("Range B is = %.2f", r_b);
ROS_INFO("Bearing B is = %.2f", theta_b);
}
}
2 | No.2 Revision |
I solved the problem. I put the if-else condition in the void callback function. Here is the code:
void Localization::callback(const ti_mmwave_rospkg::RadarScan::ConstPtr& msg)
{
id =
}