... | ... | @@ -56,7 +56,7 @@ Setup the environment |
|
|
alias tdde05-start=". /courses/TDDE05/software/bin/tdde05-start.sh"
|
|
|
```
|
|
|
|
|
|
To edit your ```.bashrc``` file, you can do the following in a terminal:
|
|
|
To edit your ```.bashrc``` file, you can use the following command in a terminal:
|
|
|
|
|
|
```bash
|
|
|
kate ~/.bashrc
|
... | ... | @@ -64,14 +64,14 @@ kate ~/.bashrc |
|
|
|
|
|
### You need to set your ROS Domain id
|
|
|
|
|
|
To avoid conflict with other ROS2 users, you need to set a unique ROS Domain id:
|
|
|
To avoid conflict with other ROS2 users, you need to set a unique ROS Domain id. You can do it using the following commands:
|
|
|
|
|
|
```bash
|
|
|
mkdir -p $HOME/TDDE05
|
|
|
kate $HOME/TDDE05/.domain_id
|
|
|
```
|
|
|
|
|
|
And in the domain id set your group number, so if you are in group 12, it should contain ``12``.
|
|
|
In the domain id set your group number. For example, if you are in group 12, the file should contain ``12``.
|
|
|
|
|
|
### Every time you open a new terminal, before issuing a ROS command, you will need to run:
|
|
|
|
... | ... | @@ -79,16 +79,16 @@ And in the domain id set your group number, so if you are in group 12, it should |
|
|
tdde05-start
|
|
|
```
|
|
|
|
|
|
Start the simulator
|
|
|
Starting the simulator
|
|
|
-------------------
|
|
|
|
|
|
* To start the platform with the simple simulator:
|
|
|
* To start the robot platform with the simple simulator:
|
|
|
|
|
|
```bash
|
|
|
ros2 launch air_bringup turtle.launch.py
|
|
|
```
|
|
|
|
|
|
If all went well, the following image should appear:
|
|
|
If all goes well, the following image should appear:
|
|
|
|
|
|
![simple_sim](uploads/303eb34883048aa7deb52ba8d0e7da01/simple_sim.png)
|
|
|
|
... | ... | @@ -97,25 +97,25 @@ The _red_ dot is the robot. The black squares are obstacles, and the dots with n |
|
|
Visualization
|
|
|
-------------
|
|
|
|
|
|
The robot is ready to take commands, but the visualization by the simulator is very limited. However, ROS provides a good visualization tool called ```RViz```. To start it, in a terminal, run:
|
|
|
The robot is ready to accept commands, but the visualization by the simulator is very limited. However, ROS provides a good visualization tool called ```RViz```. To start it, run the following command in a terminal:
|
|
|
|
|
|
```bash
|
|
|
rviz2
|
|
|
```
|
|
|
|
|
|
It should start empty and look like the following:
|
|
|
It should start with a default configuration of the tool and look like the following:
|
|
|
|
|
|
![rviz_empty](uploads/62e97910ebad5d01376885940c0d48de/rviz_empty.png)
|
|
|
|
|
|
We can add visualization using the ```add``` button, it should show a display like this:
|
|
|
We can add visualization using the ```add``` button. It should show a display like this:
|
|
|
|
|
|
![rviz_add](uploads/6ed71d5720c80f448f5adb93e1b9a7e2/rviz_add.png)
|
|
|
|
|
|
The first thing to add is called ```TF```, it shows all the frames used by the robot. Too many frames are shown, deselect all of them (uncheck ```all enabled```), and then select ```odom``` and base link. It should show the origin of the world and the current position of the robot.
|
|
|
The first thing to add is called ```TF```, which shows all the coordinate frames used by the robot. If too many frames are shown, deselect all of them (uncheck ```all enabled```). Then select ```odom``` and base link. It should show the origin of the world and the current position of the robot.
|
|
|
|
|
|
Then add a 3D model of the robot, using the ```RobotModel``` visualization, in the parameters, for ```topic``` type ```/robot_description```.
|
|
|
Then, add a 3D model of the robot, using the ```RobotModel``` visualization, in the parameters, for ```topic``` type ```/robot_description```.
|
|
|
|
|
|
Then add the map used by the robot to navigate, you can use the ```map``` visualization and then select the ```/map``` topic.
|
|
|
Then, add the map used by the robot to navigate: you can use the ```map``` visualization and then select the ```/map``` topic.
|
|
|
|
|
|
This should show a window that looks like this:
|
|
|
|
... | ... | @@ -196,7 +196,7 @@ The window should look like this: |
|
|
|
|
|
![rqt](uploads/93ef754cc99eecd6fa9eeb1b4dfc070a/rqt.png)
|
|
|
|
|
|
If you check the ```/odom``` in the topic monitor, you can see it change. In the message publisher you can add new topics and set the value to publish. Try to add ```/cmd_vel``` and publish the velocity. A more convenient alternative to controlling the velocity is to use the robot's steering panel (note that the robot does not like to move backward).
|
|
|
If you check the ```/odom``` in the topic monitor, you can see it change. In the message publisher, you can add new topics and set the value to publish. Try to add ```/cmd_vel``` and publish the velocity. A more convenient alternative to controlling the velocity is to use the robot's steering panel (note that the robot does not like to move backward).
|
|
|
|
|
|
You can also use rqt to plot topic values. Add a plot with ```Visualization > Plot```. You can then add ```/diffdrive_controller/cmd_vel_unstamped/linear/x``` and ```/diffdrive_controller/cmd_vel_unstamped/angular/z```
|
|
|
|
... | ... | @@ -258,7 +258,7 @@ In the screen configuration file: |
|
|
* ```title``` indicates the name of the tab (as shown in the list of tabs)
|
|
|
* ```stuff``` indicates the command that is run in the tab, the ```\015``` at the end indicates whether the command is run when starting the screen or if you have to start it manually
|
|
|
|
|
|
As an exercise, add a tab for the action of docking, undocking, and moving to a location (do not add ```\015``` at the end of the command line, to make sure you don't start those actions every time you start the screen file).
|
|
|
As an exercise, add a tab for the action of docking, undocking, and moving to a location (do not add ```\015``` at the end of the command line to make sure you don't start those actions every time you start the screen file).
|
|
|
|
|
|
Demonstration
|
|
|
-------------
|
... | ... | |