robot is not moving in rviz
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>
Asked by ridwan on 2020-07-27 14:49:54 UTC
Answers
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.
Asked by pcoenen on 2020-07-28 05:24:53 UTC
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?
Asked by ridwan on 2020-07-28 10:30:02 UTC
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.
Asked by pcoenen on 2020-07-29 02:54:39 UTC
@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
Asked by ridwan on 2020-07-29 03:11:46 UTC
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.
Asked by pcoenen on 2020-07-29 03:24:09 UTC
Comments