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

Interactive marker attached to a moving frame?

asked 2017-05-30 17:15:46 -0500

mogumbo gravatar image

updated 2017-05-30 17:34:41 -0500

Hi, I'm new to ROS and working in C++ and kinetic. I am able to create an interactive marker attached to the "world" frame and set its pose. But if I attach the interactive marker to a moving piece of my robot (defined with a .urdf), the interactive marker does not appear. Is there a simple example of attaching an interactive marker to a moving frame that I can scrutinize? Have been searching for one but I'm coming up empty.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2017-06-01 10:36:36 -0500

mogumbo gravatar image

updated 2017-06-01 10:44:34 -0500

That's the sort of thing I was looking for. Thank you. The problem was that I included this line when creating markers:

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

This causes interactive markers attached to moving frames to not appear. What's more, adding the stamp to just one marker causes all markers to not appear, not just the one that has the stamp. Adding a stamp does not appear to cause any problems for markers in the "world" frame that have their poses updated constantly.

I read some about tf and timestamps, but I still don't understand what's going on here. Can anyone explain it?

edit flag offensive delete link more

Comments

1

I ran into this problem also, and made an issue here: https://github.com/ros-visualization/...

lucasw gravatar image lucasw  ( 2017-06-08 08:06:13 -0500 )edit

If you assign a (valid) timestamp, the marker should appear but not be moving at all, since it will use the transform from that particular moment in time. Might be a bug. See http://docs.ros.org/jade/api/visualiz...

dgossow gravatar image dgossow  ( 2017-06-08 20:58:06 -0500 )edit

Do you run this on multiple computers, i.e. ros::Time::now() is not from the same clock as the tf info?

dgossow gravatar image dgossow  ( 2017-06-08 21:00:39 -0500 )edit

It's the same computer. I'm not going to guess whether or not this is a bug--I haven't been using ROS long enough.

mogumbo gravatar image mogumbo  ( 2017-06-08 22:14:33 -0500 )edit
2

answered 2017-05-31 07:48:31 -0500

The basic_controls example in the interactive_marker_tutorials package has a moving marker. There is a tf broadcaster that uses a timer to repeatedly update the transform between base_link and moving_frame. The moving marker uses moving_frame as its frame_id, and if you set the base_link frame as the fixed frame in rviz, you'll see the moving marker move in a sinusoidal pattern (even though its pose in the moving_frame frame is fixed).

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2017-05-30 17:15:46 -0500

Seen: 1,454 times

Last updated: Jun 01 '17