Embedded Motion Control/Tutorials/Setting up the PICO simulator 2015: Difference between revisions
Line 58: | Line 58: | ||
Try driving the robot around using 'pico-teleop' and notice how the laser data changes, and how it differs from the actual virtual world. | Try driving the robot around using 'pico-teleop' and notice how the laser data changes, and how it differs from the actual virtual world. | ||
= Stopping the simulator and visualization = | |||
You can stop the simulator and visualization by pressing ''ctrl-C'' in the terminal. |
Revision as of 12:27, 29 April 2015
Introduction
During the course, we have 10 large groups and only one robot, so test time on the robot is scarce. Fortunately, we have a virtual (software) representation of the robot that can be used to simulate the robot. At the moment it:
- Simulates the movement of the robot
- The laser data of the robot, created by the virtual environment
- Provide a simple visualization
This should already be enough to get you started, and more will be added later (odometry, better dynamics, etc).
Updating the simulator
Before you start working with the simulator, make sure you have our latest version by running
emc-update
This will download the latest changes and compile the updated software (framework and simulator). I will notify you when I made changes to the software such that you can run the updater, but feel free to run the command whenever you want.
Starting the simulator
As was already stated before, we will not be using ROS in this course, unless you really want to use it yourself. However, secretly the provided tools are build on top of that; the inter-process communication to be more specific. Don't worry about it too much. The only thing you need to know is that before running the simulator or your software, you need to create a roscore. Simply open a terminal an run:
roscore
and keep it running. This allows processes to 'find' each other and communicate. For example, the software abstraction layer we provide 'talks' to the simulator through this roscore.
Enough about ROS, let's start the simulator! Open a terminal and run
emc-sim
That's it! What you will see, is a visualization of the virtual environment (the white lines are walls) and a top-down view of the robot (the red lines).
Controlling the robot
Now, as you can see, not much is happening. The robot is standing still in a static environment. Let's change that! A first simple way to test the simulator is by controlling the robot using your keyboard. Just run:
pico-teleop
and you will be able to control the robot using the numpad keys. You can rotate the robot using '/' and '*'.
Visualization
As you already noticed, the simulator pops up a visualization windows showing the robot in the virtual world. This shows how to world is (at least in simulation...). It is also very interesting to know how to robot perceives the world through its sensors. Note that this is a big difference! We also created a visualization for that. Just run
emc-viz
You will again see the robot footprint displayed in red. However, the walls are gone and replaced by the actual (simulated) sensor data from the robot (the blue dots). The laser data is actually represented in polar coordinates (remember, the LRF is a laser with a rotating mirror, so what it will return are angles and distances) but the visualization 'projects' them back to world coordinates. See how the laser data changes even if the robot is standing still: this is the simulated noise added to the data.
Try driving the robot around using 'pico-teleop' and notice how the laser data changes, and how it differs from the actual virtual world.
Stopping the simulator and visualization
You can stop the simulator and visualization by pressing ctrl-C in the terminal.