ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

base_pose_ground_truth type? [closed]

asked 2015-07-16 04:52:01 -0500

Alvaro Salcedo gravatar image

Hello ros users. I am trying to subscribe to base_pose_ground_truth topic but I can't. My code is this:

nav_msgs::base_pose_ground_truth subs;
 double variable1;
 double variable2;
 void velsubcallback(const nav_msgs::base_pose_ground_truth& msg)
   {

  variable1=msg.twist.twist.linear.x;
    variable2=msg.twist.twist.angular.z;
     lectura_ros.linear=variable1;
     lectura_ros.angular=variable2;
     ROS_INFO("variable %f",lectura_ros.linear);

How can i subscribe on that topic?

Thanks!

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alvaro Salcedo
close date 2015-07-20 05:48:36.494302

1 Answer

Sort by » oldest newest most voted
2

answered 2015-07-16 06:54:01 -0500

mgruhler gravatar image

You are trying to subscribe to a topic of (message) type nav_msgs::base_pose_ground_truth. As far as I know, the (named) topic /base_pose_ground_truth is actually of type nav_msgs::Odometry (you can check with rostopic info /base_pose_ground_truth when the node is running).

So replace nav_msgs::base_pose_ground_truth with nav_msgs::Odometry. And don't forget to properly initialize your Subscriber.

edit flag offensive delete link more

Comments

Yes! That´s the way! base_pose_ground_truth topic give me the velocities relative to world coordinates and I want relative to base_link coordinates. is there any way to make a transform between these coordinates?

Thanks!

Alvaro Salcedo gravatar image Alvaro Salcedo  ( 2015-07-16 14:30:20 -0500 )edit

Why don't you use the 'odom' topic then? Otherwise, I think you have to transform it yourself, which is straightforward. You know the global pose and velocity. So just rotate the (translational) velocity vector to compensate for the current rotation. The rotational velocity is constant (as it is 2D)

mgruhler gravatar image mgruhler  ( 2015-07-17 01:13:32 -0500 )edit

Thanks again @mig I can't subsbribe to odom topic because I must have gaussian noise and in odom topic there isn't. how can I rotate de axes? because if I rotate linear velocity in X an angle equal to angular velocity in Z it should work. But how can I do that? what is the command in C++?

Thanks!!

Alvaro Salcedo gravatar image Alvaro Salcedo  ( 2015-07-17 04:13:01 -0500 )edit

Can you accept the answer, if it solved the original question (by clicking on the checkmark)? Thx. I don't know a specific command. I would have coded that myself. Or try transformVector

mgruhler gravatar image mgruhler  ( 2015-07-17 05:53:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-07-16 04:52:01 -0500

Seen: 933 times

Last updated: Jul 16 '15