Publish odometry information using odom_data on ROS

Typically: "How do I... ", "How can I... " questions
Post Reply
hypnosfeel
Posts: 22
Joined: 03 Mar 2014, 16:05

Publish odometry information using odom_data on ROS

Post by hypnosfeel » 04 Mar 2014, 02:35

Hello all,
I want to use the new "simros_strmcmd_get_odom_data" publisher to publish odometory information. But I notice the auxString parameter is a string containing 72 values( two covaniance matrices), how can I translate the pose(x,y,z,quaternion) and twist(x,y,z,x_ang,y_ang,z_ang) data into the "auxString "? Can you give me an example?

Best,
Ray

coppelia
Site Admin
Posts: 7691
Joined: 14 Dec 2012, 00:25

Re: Publish odometry information using odom_data on ROS

Post by coppelia » 04 Mar 2014, 08:03

Hello Ray,

you need to provide 2*36 values: 36 values for the pose with covariance, and 36 values for the twist with covariance.

In Lua, you would pack the 72 values into a string like in following example:

Code: Select all

odomData={...} -- table with 72 values
packedOdomData=simPackFloats(odomData)
and you would used the packedOdomData as the auxString argument in the simExtROS_enablePublisher function.

Cheers

hypnosfeel
Posts: 22
Joined: 03 Mar 2014, 16:05

Re: Publish odometry information using odom_data on ROS

Post by hypnosfeel » 08 Mar 2014, 16:20

Hello coppelia,

thank you very much and sorry for my late reply. I know how to enable the publisher and pack the data.
It is the two covariance matrices that confuse me. Take the "pose with covariance" for example.
If I know (x,y,z, orientation), should I pack them in the covariance matric with 36 values? To my knowledge,the covariance matric in ROS does not contain pose information. It look like the following?

Code: Select all

covaniance matric=[
a  0  0  0  0  0
0  b  0  0  0  0
0  0  c  0  0  0 
0  0  0  d  0  0
0  0  0  0  e  0
0  0  0  0  0  f
]
It seems impossible to contain both pose(x,y,z, orientation) and covaniance information just using 36 values.

Best,
Ray

coppelia
Site Admin
Posts: 7691
Joined: 14 Dec 2012, 00:25

Re: Publish odometry information using odom_data on ROS

Post by coppelia » 09 Mar 2014, 22:24

You will have to see with the ROS people how the message data is organized, since this is a ROS message structure. Or maybe you could also check with George (V-REP forum user jorge), who generously implemented that odometry publisher in the ROS plugin for V-REP.

Cheers

hypnosfeel
Posts: 22
Joined: 03 Mar 2014, 16:05

Re: Publish odometry information using odom_data on ROS

Post by hypnosfeel » 10 Mar 2014, 09:58

Hello coppelia,

thanks a lot!

Best,
Ray

jorge
Posts: 4
Joined: 20 Nov 2013, 21:08

Re: Publish odometry information using odom_data on ROS

Post by jorge » 12 Mar 2014, 18:10

I'm gonna copy my reply to Ray for future reference, since it has resolved his issue.
--
Hi Ray,

the odom publisher in VREP needs only the covariance matrices (72 values), and not the pose + twist info, which are calculated automatically by VREP. The odom msg specification demands both the pose and twist parts to be present. You can't just use one. That said, if you know only the coavriance matrix about one of the parts (for example just pose), you will still need to input 72 values in the auxstring. 36 values will be the covar matrix of the pose, and the rest 36 will be zero. Matrices are serialized in the string in row-major order.

Best
George
--

coppelia
Site Admin
Posts: 7691
Joined: 14 Dec 2012, 00:25

Re: Publish odometry information using odom_data on ROS

Post by coppelia » 13 Mar 2014, 10:59

Thanks George!

Post Reply