Simple Interactive_marker_proxy example [closed]

asked 2014-07-15 15:13:49 -0600

David Lu gravatar image

I'm trying to figure out the logic of interactive_marker_proxy by starting with a simple example, publishing a marker in one frame, and trying to get it translated into a different frame. However, by echoing /r2_teleop/tunneled/update, it appears to stay in the original frame.

Here is my launch file:

<launch>
    <node name="interactive_marker_proxy" pkg="interactive_marker_proxy" type="proxy" output="screen">
         <remap from="topic_ns" to="/r2_teleop" />
         <remap from="target_frame" to="world" />
    </node>

    <node name="static_tf0" type="static_transform_publisher" pkg="tf" args="0 0 1 0 0 0 /world /up 100"/>
</launch>

And here is how I publish the marker.

#!/usr/bin/env python

import roslib; roslib.load_manifest("interactive_markers")
import rospy
from visualization_msgs.msg import *

from interactive_markers.interactive_marker_server import *

if __name__=="__main__":
    rospy.init_node("simple_marker")
    server = InteractiveMarkerServer("r2_teleop")

    int_marker = InteractiveMarker()
    int_marker.header.frame_id = "/up"
    int_marker.name = "my_marker"

    box_marker = Marker()
    box_marker.type = Marker.CUBE
    box_marker.scale.x = 0.45
    box_marker.scale.y = 0.45
    box_marker.scale.z = 0.45
    box_marker.color.r = 0.0
    box_marker.color.g = 0.5
    box_marker.color.b = 0.5
    box_marker.color.a = 1.0
    box_marker.header.frame_id = '/up'

    box_control = InteractiveMarkerControl()
    box_control.always_visible = True
    box_control.markers.append( box_marker )
    int_marker.controls.append( box_control )

    while not rospy.is_shutdown():
        server.insert(int_marker)
        server.applyChanges()
        rospy.sleep(.5)
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by David Lu
close date 2018-09-18 21:50:02.944567

Comments

David Lu gravatar image David Lu  ( 2014-07-16 18:12:09 -0600 )edit

I think the remaps in your launch file should be params. Otherwise, your code looks like it should work :)

T045T gravatar image T045T  ( 2014-09-29 15:54:01 -0600 )edit