publish a Marker in a moving frame

asked 2021-02-01 18:11:34 -0600

mateusguilherme gravatar image

Hello

I would like to publish a Maker that is in the odometry frame, however as the AMCL adjusts the position of the odometry frame, I would like the position of the Marker to also change to fit with the new position of the odometry frame.

My Marker:

    dockMarker = Marker()
    dockMarker.header.frame_id = "/odom"
    dockMarker.ns = "dock"
    dockMarker.id = 0
    dockMarker.type = dockMarker.MESH_RESOURCE
    dockMarker.action = 0
    dockMarker.pose.position.x =x
    dockMarker.pose.position.y =y
    dockMarker.pose.orientation.x = 0.0
    dockMarker.pose.orientation.y = 0.0
    dockMarker.pose.orientation.z = z
    dockMarker.pose.orientation.w = w
    dockMarker.scale.x = 0.024
    dockMarker.scale.y = 0.024
    dockMarker.scale.z = 0.024

    dockMarker.mesh_resource = "package://auto_docking/meshes/dock_model_with_texture.dae"

    dockMarker.mesh_use_embedded_materials =  True
    dockMarker.color.r = 0.0
    dockMarker.color.g = 0.0
    dockMarker.color.b = 0.0
    dockMarker.color.a = 0.0

    markerPub.publish(dockMarker)

Why isn't the Marker moved along with the odometry frame when it moves? It is possible?

edit retag flag offensive close merge delete