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

Filling in time stamp data for rxplot

asked 2011-09-01 08:06:16 -0500

Gideon gravatar image

updated 2011-09-05 03:21:47 -0500

joq gravatar image

Hello everyone, I am plotting a message using rxplot and all the data is at t = 0. I have been poking around this forum and I found a conversation saying that time stamp data must be filled in (which isnt mentioned in the tutorial for rxplot, maybe this should be mentioned). Do I have to go through each node that publishes a message and time stamp it (i.e in main before spin doing something like topic.header.stamp = ros::Time::now(); ) Do I stamp it when it is received by another node? I have messages being sent all over the place so I am hesitant to do this, so I want to make sure this is what I need to do before hand.

Thanks

Gideon

edit retag flag offensive close merge delete

Comments

can you post the code for what you're trying to do?
mmwise gravatar image mmwise  ( 2011-09-01 08:09:43 -0500 )edit
Strange, I am plotting messages that don't have a header in rxplot, and they are plotted just fine. From what I see, messages do not need a Header. I am beginning to design a new ROS-based system, so I'd like to have this confirmed before I create all my messages.
brice rebsamen gravatar image brice rebsamen  ( 2011-10-13 15:00:46 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
4

answered 2011-09-01 08:41:25 -0500

Gideon gravatar image

I think I figured it out. I prepended my message with

uint32 seq time stamp string frame_id

and inside my publisher method I have something like

planner::TargetStates msg

after filling in all of the fields and before publishing time stamp the message with

msg.header.stamp = ros::Time::now();

Then rxplot works and generates plots over time. I hope this helps fellow rostards like myself

Cheers

Gideon

edit flag offensive delete link more

Comments

Do you even need to prepend the message with a frame_id? I think if you add a 'Header header' as the first field in your custom message then you can fill in the timestamp using the call you found of 'msg.header.stamp = ros::Time::now()'.
Thomas D gravatar image Thomas D  ( 2011-09-01 09:31:02 -0500 )edit
Sweet, thanks
Gideon gravatar image Gideon  ( 2011-09-01 11:39:46 -0500 )edit

Question Tools

Stats

Asked: 2011-09-01 08:06:16 -0500

Seen: 4,853 times

Last updated: Sep 01 '11