ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

robot is not moving in rviz

asked 2020-07-27 14:49:54 -0600

ridwan gravatar image

updated 2022-03-04 06:57:00 -0600

lucasw gravatar image

Hi, i have a model, it is working fine in gazebo but in rviz it is not moving at all. The wheels are rotating but the robot's position is not changing at all.

Here are mu links: I used dummy link in rviz global fixed frame.

    <link name="dummy">
   </link>

  <link name="link_chassis">
    <!-- pose and inertial -->
    <pose>0 0 0.1 0 0 0</pose>
    <inertial>
      <mass value="5"/>
      <origin rpy="0 0 0" xyz="0 0 0.1"/>
      <inertia ixx="0.0395416666667" ixy="0" ixz="0" iyy="0.106208333333" iyz="0" izz="0.106208333333"/>
    </inertial>
    <!-- body -->
    <collision name="collision_chassis">
      <geometry>
        <box size="0.5 0.3 0.07"/>
      </geometry>
    </collision>
    <visual>
      <origin rpy="0 0 0" xyz="0 0 0"/>
      <geometry>
        <box size="0.5 0.3 0.07"/>
      </geometry>
      <material name="blue"/>
    </visual>
    <!-- caster front -->

  </link>

    <joint name="dummy_joint" type="fixed">
     <parent link="dummy"/>
     <child link="link_chassis"/>
   </joint>


  <link name="sensor_laser">
    <inertial>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <mass value="1" />
      <xacro:cylinder_inertia mass="1" r="0.05" l="0.1" />
    </inertial>

    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
        <cylinder radius="0.05" length="0.1"/>
      </geometry>
      <material name="white" />
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="0 0 0"/>
      <geometry>
        <cylinder radius="0.05" length="0.1"/>
      </geometry>
    </collision>
  </link>

  <joint name="joint_sensor_laser" type="fixed">
    <origin xyz="0.15 0 0.05" rpy="0 0 0"/>
    <parent link="link_chassis"/> 
    <child link="sensor_laser"/>
  </joint>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-07-28 05:24:53 -0600

pcoenen gravatar image

The problem is that you're using dummy link as your fixed frame. It has a fixed joint to your robot's chassis, so while the robot is moving through the world you're moving alongside it, giving the appearance of no movement at all.

Try changing the fixed frame to maybe "world", "map" or "odom" if you have those in your tf tree.

edit flag offensive delete link more

Comments

I dont have them in tf tree. So what can i do? @pcoenen or how can i modify it? the robot was custom made and i'm new to ros, so could u give me suggestions?

ridwan gravatar image ridwan  ( 2020-07-28 10:30:02 -0600 )edit

If you don't have some form of localization in your system those frames might not be there. Be aware, that your robot is moving, but due to your chosen fixed frame it does not appear that way. You're basically sitting in the drivers seat of your car. If it's pitch black outside you will not perceive any movement. Try visualizing the laser scan of your sensor. If there are any obstacles in Gazebo you will get a sense of the world moving around your "car" in RViz.

pcoenen gravatar image pcoenen  ( 2020-07-29 02:54:39 -0600 )edit

@pcoenen, what if i dont want to use the laser scan, what i basically wanted is to move the robot in a given path, and see the result in rviz. i will only use 4 wheels, no other external sensor like laser or camera. how do i do that then

ridwan gravatar image ridwan  ( 2020-07-29 03:11:46 -0600 )edit

What I meant to make clear is that your robot _is_ moving. If you manage to visualize a path, it will show up behind your robot.

pcoenen gravatar image pcoenen  ( 2020-07-29 03:24:09 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-07-27 14:49:54 -0600

Seen: 2,181 times

Last updated: Jul 28 '20