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

Revision history [back]

click to hide/show revision 1
initial version

You cannot use rviz on its own for your purpose, since you want to simulate a carlike robot. rviz is just a visualization.

You have three options for simulating a carlike robot:

  1. [not recommended] Write your own simulation model (implement the discrete equations of motion and publish the current state to rviz)
  2. Write a gazebo plugin for your carlike robot (this might be more advanced)
  3. Use the 2D - simulator stage.

I would prefer option 3 for your task, since stage is able to simulate your carlike motion as well as laser/sonar range sensors. This should be enough for your AMCL task. You can also add noise to your motion model (in the stage config), which is great for your evaluation.

In order to setup stage, your can refer to the following links:

If you check out the turtlebot stage package, you will find the turtlebot.inc file (which is loaded from your stage world file):

define turtlebot position
(
   pose [ 0.0 0.0 0.0 0.0 ]
   odom_error [0.03 0.03 999999 999999 999999 0.02]
   size [ 0.2552 0.2552 0.40 ]
   origin [ 0.0 0.0 0.0 0.0 ]
   gui_nose 1
   drive "diff" # change to "car" for your carlike robot ["diff", "omni" or "car"]
   color "gray"
   kinect(pose [ -0.1 0.0 -0.11 0.0 ]) # replace this with laser / sonar information

   # ADD THE FOLLOWING PARAMETER:
   # only used if drive is set to "car"
   wheelbase 1.0
)

You must also define the wheelbase. You might better refer to the example in the Stage manual (see link above).

After stage is running your model, you need to command the velocity and steering angle. Here you can chose either your joystick, a predefined control sequence (programmed) or some planner as Orhangazi44 suggested (e.g. dwa_local_planner or teb_local_planner).