Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The frame_id of your sonar message should match the name of the link you have given the sensor in the urdf, e.g.

if your robot.urdf has this link for your sensor:

        <link name="sonar_backward">
            <visual>
                    <geometry>
                            <box size="0.016 0.044 0.02"/>
                    </geometry>
                    <origin xyz="${0.016/2} 0 0" rpy="0 0 0"/>
                    <material name="green">
                            <color rgba="0 1 0 0.8"/>
                    </material>
            </visual>
    </link>

then your message should have set msg.header.frame_id="sonar_backward". Of course this also requires a running joint_state_publisher that publishes the corresponding joints.

Next you need to check your tf tree contains a valid path from your Fixed Frame in rviz (usually odom or map) to your sensor (sonar_backward).