TF status:warn and move robot in rviz [closed]

asked 2019-09-01 12:27:03 -0500

Pakras gravatar image

updated 2019-09-02 03:49:02 -0500

Hi, i have urdf robor model, i want it to move in rviz but u meet this problem. in Rviz TF status:warn No transform from [moon_tf/base_footprint] to frame [base_footprint]

rviz.launch

<launch>

  <arg name="model" default="$(find moon)/src/urdf/rmoon.urdf"/>
  <arg name="gui" default="true" />
  <arg name="rvizconfig" default="$(find rviz_moon)/src/rviz.rviz" />
  <param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
  <param name="use_gui" value="$(arg gui)"/>

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />

</launch>

plugins in urdf

<plugin name="ground_truth" filename="libgazebo_ros_p3d.so">
    <frameName>map</frameName>
    <bodyName>base_link</bodyName>
    <topicName>odom</topicName>
    <updateRate>30.0</updateRate>
  </plugin>


  <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/moon</robotNamespace>
<legacyModeNS>true</legacyModeNS>
  </plugin>

launch files

<launch>
  <param name="/use_sim_time" value="true" />

  <!-- start world -->
  <node name="gazebo" pkg="gazebo_ros" type="gazebo" 
   args="$(find moon)/src/stair.world" respawn="false" output="screen" />

  <!-- start gui -->
   <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/> 


  <!-- include our robots -->
  <include file="$(find moon)/src/launch/robots.launch"/>

</launch> 

<launch>
  <!-- No namespace here as we will share this description. 
       Access with slash at the beginning -->
  <param name="robot_description"
    command="cat '$(find moon)/src/urdf/rmoon.urdf'" />

<!-- BEGIN ROBOT 0-->
  <group ns="moon">
    <param name="tf_prefix" value="moon_tf" />s
    <include file="$(find moon)/src/launch/one_robot.launch" >
      <arg name="init_pose" value="-x 0 -y 0 -z 1" />
      <arg name="robot_name"  value="moon" />
     </include>
</group>
</launch>


<launch>
    <arg name="robot_name"/>
    <arg name="init_pose"/>

    <node name="spawn_moon" pkg="gazebo_ros" type="spawn_model"
     args="$(arg init_pose) -urdf -param /robot_description -model $(arg robot_name)"
     respawn="false" output="screen" />

    <node pkg="robot_state_publisher" type="state_publisher" 
          name="robot_state_publisher" output="screen"/>

    <!-- The odometry estimator, throttling, fake laser etc. go here -->
    <!-- All the stuff as from usual robot launch file -->
</launch>

what i should do to move my robot in rviz

TF tree pdf https://drive.google.com/open?id=1JeO...

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Pakras
close date 2019-09-02 12:15:48.594213

Comments

Can you also attach an screen shot of the rqt Tf tree. Looks like a name space issue.

Eisenhorn gravatar image Eisenhorn  ( 2019-09-02 03:41:58 -0500 )edit

@Eisenhorn edited

Pakras gravatar image Pakras  ( 2019-09-02 03:49:55 -0500 )edit

This seems like an Rviz configuration issue. It looks like you are trying to visualize "base_footprint" frame but your TF's are in the namespace "moon_tf". So change the frame option of the tab giving errors to the option with the namespace. It should appear in the dropdown list. You can also visualize the tf's your setup is generating with rosrun rqt_tf_tree rqt_tf_tree

Reamees gravatar image Reamees  ( 2019-09-02 03:53:58 -0500 )edit
2

Never mind my previous comment, from the tf_tree you posted you can see that there are several unconnected pieces. Before making any changes to the rviz config. I would start by adding the line <param name="tf_prefix" value="moon_tf" /> in your rviz.launch before the line <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />.

Reamees gravatar image Reamees  ( 2019-09-02 04:09:09 -0500 )edit