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">
                            <box size="0.016 0.044 0.02"/>
                    <origin xyz="${0.016/2} 0 0" rpy="0 0 0"/>
                    <material name="green">
                            <color rgba="0 1 0 0.8"/>

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).