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

model not moving in Rviz but is moving in Gazebo

asked 2016-01-05 21:45:32 -0500

ngoldfarb gravatar image


I am trying to create costume robot. I have been trying to follow this tutorial.

I can get the robot up in Gazebo and move it with my controller but I cannnot get it to move in Rviz. My goal is to use the navigation stack to create paths for the robot to follow. (if someone know a way to do this with out Rviz I am all for it) I am controlling it with joystick inputs and have independently controlled wheels(balls).

Thank you for any help. I have spent so many hours on this.

Here is my Xacro description file and launch file.

omnishot.urdf.xacro <robot name="omnishot" xmlns:xacro="">

  <!-- Included URDF/XACRO Files -->
  <xacro:include filename="$(find omni_shot)/urdf/materials.urdf.xacro" />
  <xacro:include filename="$(find omni_shot)/urdf/ball.urdf.xacro" />

  <!-- PROPERTY LIST -->
  <!--All units in m-kg-s-radians unit system -->
  <property name="M_PI" value="3.1415926535897931" />

  <!-- Main Body-base -->
  <property name="base_size" value=".84" /> 
  <property name="base_height" value="0.66" /> 
  <property name="leg" value="0.3" /> 
  <property name="base_mass" value="300" /> <!-- in kg-->
 <property name="M_SCALE" value="1" />
  <!--Inertial macros for the box and cylinder. Units are kg*m^2-->
  <macro name="box_inertia" params="m x y z">
    <inertia  ixx="${m*(y*y+z*z)/12}" ixy = "0" ixz = "0"
              iyy="${m*(x*x+z*z)/12}" iyz = "0"
              izz="${m*(x*x+z*z)/12}" /> 

  <!-- base_footprint is a fictitious link(frame) that is on the ground right below base_link origin -->
  <link name="odom">

        <origin xyz="0 0 0" rpy="0 0 0" />
            <box size="0.001 0.001 0.001" />

  <gazebo reference="base_footprint">

  <joint name="base_footprint_joint" type="fixed">
  <origin xyz="0 0 ${ball_radius - base_z_origin_to_ball_origin}" rpy="0 0 0" />
    <parent link="odom"/>
    <child link="base_link" />

  <!-- BASE-LINK -->
  <!--Actual body/chassis of the robot-->
  <link name="base_link">
      <mass value="${base_mass}" />
      <origin xyz="0 0 0" />
      <!--The 3x3 rotational inertia matrix. -->
      <box_inertia  m="${base_mass}" x="${base_size}" y="${base_size}" z="${base_height}"/> 
      <origin xyz="0 0 .38" rpy="0 0 0" />
         <mesh filename="file:///home/nathaniel/Documents/Omnibot/code/catkin_ws/src/omni_shot/models/omniShotFlip.stl" scale="${M_SCALE} ${M_SCALE} ${M_SCALE}"/>
      <material name="Yellow" />
      <origin xyz="0 0 0" rpy="0 0 0" />
        <box size="${base_size} ${base_size} ${base_height}"/>
  <gazebo reference="base_link">

  <!-- WHEELs -->

 <ball name="m1" parent="base_link" x="0"  y="${leg}"  move="0"/>
 <ball name="m2" parent="base_link" x="${-leg}" y="0"  move="1"/>
 <ball name="m3" parent="base_link" x="0"  y="${-leg}" move="0"/>
 <ball name="m4" parent="base_link" x="${leg}"  y="0"  move="1"/>

  <plugin name="gazebo_ros_control" filename="">



<?xml version="1.0"?>
<robot name="ball" xmlns:xacro="http://www ...
edit retag flag offensive close merge delete


Hey ngoldfarb, were you able to solve your problem? I'm facing the same problem at the moment... My robot is moving in gazebo, but it is staying at the initial pose in rviz, so that I am not able to create a map

gleb gravatar image gleb  ( 2016-09-05 11:09:19 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2016-01-06 00:29:22 -0500

Humpelstilzchen gravatar image

updated 2016-01-06 09:07:58 -0500

ok for starters you have a link named "odom" in your urdf. This is probably not what you want, because this way the joint of base_link to odom (the position of the robot in the odom frame) can not change.

Your robot will not move unless the tf between odom and base_link is updated.

Please take a look at the Gazebo Ros tutorials on how to use the differential or skid steering plugin.

edit flag offensive delete link more


I changed to "odom" frame to "base_footprint" and it did not change anything.The problem is that I am trying to simulate a holonomic robot, with a unique wheel layout. I need to have control over each wheel on the robot.

ngoldfarb gravatar image ngoldfarb  ( 2016-01-06 08:43:06 -0500 )edit

Maybe take a look at the PlanarMovePlugin, I've never used it but from the description it should be able to move your bot in any direction.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2016-01-06 09:06:39 -0500 )edit

If i use the planermoveplugin do I control the individual wheel speeds or the speed of the robot?

ngoldfarb gravatar image ngoldfarb  ( 2016-01-06 14:18:01 -0500 )edit

answered 2017-03-30 07:25:40 -0500

Arun Kumar gravatar image

Hi, I had similar problem where my robot was able to move in gazebo but was fixed in rviz.Only the wheels were moving.I checked Fixed Frame attribute under Global Options in Rviz and found out that it had "base_link".I solved it by changing it to "map".

edit flag offensive delete link more

answered 2018-08-08 21:49:19 -0500

FerdeLance gravatar image

Similar to the answer by @Arun Kumar. I changed mine from "base_link" to odom and it worked perfectly.

edit flag offensive delete link more

Question Tools



Asked: 2016-01-05 21:45:32 -0500

Seen: 4,947 times

Last updated: Aug 08 '18