Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags. |
Use multiple LSE miniQs
Description: This tutorial will show you how to run multiple LSE miniQs with ROS including the simple navigation for multiple robots.Keywords: miniQ, multiple
Tutorial Level: BEGINNER
Overview
For this tutorial you'll need the following items:
- LSE miniQ robots
- XBee module connected to a computer running ROS
SwisTrack compatible camera (optional)
Running multiple LSE miniQs
To run multiple LSE miniQs you only have to launch one file:
roslaunch lse_miniq_bringup multi_miniq.launch
The launch files contains the following lines for launching 2 robots (LSE miniQ 1 and 2):
1 <launch>
2
3 <!-- Define a list of miniQ ids -->
4 <rosparam param="list_of_ids">[1, 2]</rosparam>
5
6 <!-- Run the miniQ node -->
7 <node name="miniq_node" pkg="lse_miniq_driver" type="multi_miniq_node" output="screen"></node>
8
9 <group ns="robot_1">
10 <param name="tf_prefix" value="robot_1" />
11
12 <!-- The robot urdf for visualization -->
13 <param name="robot_description" command="$(find xacro)/xacro.py $(find lse_miniq_description)/urdf/miniq.urdf" />
14 <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
15 <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
16
17 <!-- Run simple navigation for robot 1 -->
18 <node name="move_base_simple" pkg="move_base_simple" type="multi_move_base_simple" output="screen">
19 <param name="my_id" type="int" value="1" />
20 <rosparam file="$(find lse_miniq_bringup)/settings/navigation.yaml" command="load" />
21 </node>
22 </group>
23
24 <group ns="robot_2">
25 <param name="tf_prefix" value="robot_2" />
26
27 <!-- The robot urdf for visualization -->
28 <param name="robot_description" command="$(find xacro)/xacro.py $(find lse_miniq_description)/urdf/miniq.urdf" />
29 <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
30 <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
31
32 <!-- Run simple navigation for robot 2 -->
33 <node name="move_base_simple" pkg="move_base_simple" type="multi_move_base_simple" output="screen">
34 <param name="my_id" type="int" value="2" />
35 <rosparam file="$(find lse_miniq_bringup)/settings/navigation.yaml" command="load" />
36 </node>
37 </group>
38
39 </launch>
This launch file will run the multi_miniq_node which will connect to the XBee and communicate with all the robots in the network. It will also start the following software for each robot: the URDF model of the LSE miniQ and the multi_move_base_simple node for navigation. The move_base_simple package was developed having the LSE miniQs in mind and it supports multiple robots.
Right now the LSE miniQs are running on odometry, which is bad! Really bad! To correct that you should also run swistrack.
SwisTrack
Running multiple LSE miniQs with swistrack will improve the overall localization. The software you need to launch is similar only now you'll also be running swistrack plus a node for publishing the tf between each LSE miniQ's odometry and their global pose as seen by the camera. This means you can also run map server. The following diagram shows the overall system.
To start swistrack run the following line (after running a roscore):
roscd swistrack rosrun swistrack SwisTrack
You should now have the following window in front of you:
Now press the "Open" button and select the swistrack settings file located at "/lse_miniq_bringup/settings/miniq.swistrack". Notice that the robots should be in the positions declared in the "/lse_miniq_bringup/settings/initial_poses.yaml" file since this is the only way the swistrack_tf_broadcaster node has to determine which swistrack id corresponds to which robot at startup. Now press "Run", you should see something like this:
To run the LSE miniQs (1, 2, 4, 5 and 6, 3 is currently damaged!) you only have to launch one file:
roslaunch lse_miniq_bringup lse_miniqs.launch
The launch file contains the following lines:
1 <launch>
2
3 <!-- Define a list of miniQ ids -->
4 <rosparam param="list_of_ids">[1, 2, 4, 5, 6]</rosparam>
5
6 <!-- Run the miniQ node -->
7 <node name="miniq_node" pkg="miniq_driver" type="multi_miniq_node" output="screen"></node>
8
9 <group ns="robot_1">
10 <param name="tf_prefix" value="robot_1" />
11
12 <!-- The robot urdf for visualization -->
13 <param name="robot_description" command="$(find xacro)/xacro.py $(find miniq_description)/urdf/miniq.urdf" />
14 <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
15 <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
16
17 <!-- Run simple navigation for robot 1 -->
18 <node name="move_base_simple" pkg="move_base_simple" type="multi_move_base_simple" output="screen">
19 <param name="my_id" type="int" value="1" />
20 <rosparam file="$(find lse_miniq_bringup)/settings/navigation.yaml" command="load" />
21 </node>
22 </group>
23
24 <group ns="robot_2">
25 <param name="tf_prefix" value="robot_2" />
26
27 <!-- The robot urdf for visualization -->
28 <param name="robot_description" command="$(find xacro)/xacro.py $(find miniq_description)/urdf/miniq.urdf" />
29 <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
30 <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
31
32 <!-- Run simple navigation for robot 2 -->
33 <node name="move_base_simple" pkg="move_base_simple" type="multi_move_base_simple" output="screen">
34 <param name="my_id" type="int" value="2" />
35 <rosparam file="$(find lse_miniq_bringup)/settings/navigation.yaml" command="load" />
36 </node>
37 </group>
38
39 <group ns="robot_4">
40 <param name="tf_prefix" value="robot_4" />
41
42 <!-- The robot urdf for visualization -->
43 <param name="robot_description" command="$(find xacro)/xacro.py $(find miniq_description)/urdf/miniq.urdf" />
44 <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
45 <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
46
47 <!-- Run simple navigation for robot 4 -->
48 <node name="move_base_simple" pkg="move_base_simple" type="multi_move_base_simple" output="screen">
49 <param name="my_id" type="int" value="4" />
50 <rosparam file="$(find lse_miniq_bringup)/settings/navigation.yaml" command="load" />
51 </node>
52 </group>
53
54 <group ns="robot_5">
55 <param name="tf_prefix" value="robot_5" />
56
57 <!-- The robot urdf for visualization -->
58 <param name="robot_description" command="$(find xacro)/xacro.py $(find miniq_description)/urdf/miniq.urdf" />
59 <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
60 <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
61
62 <!-- Run simple navigation for robot 5 -->
63 <node name="move_base_simple" pkg="move_base_simple" type="multi_move_base_simple" output="screen">
64 <param name="my_id" type="int" value="5" />
65 <rosparam file="$(find lse_miniq_bringup)/settings/navigation.yaml" command="load" />
66 </node>
67 </group>
68
69 <group ns="robot_6">
70 <param name="tf_prefix" value="robot_6" />
71
72 <!-- The robot urdf for visualization -->
73 <param name="robot_description" command="$(find xacro)/xacro.py $(find miniq_description)/urdf/miniq.urdf" />
74 <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
75 <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
76
77 <!-- Run simple navigation for robot 6 -->
78 <node name="move_base_simple" pkg="move_base_simple" type="multi_move_base_simple" output="screen">
79 <param name="my_id" type="int" value="6" />
80 <rosparam file="$(find lse_miniq_bringup)/settings/navigation.yaml" command="load" />
81 </node>
82 </group>
83
84 <!-- Run swistrack_tf_broadcaster node -->
85 <node name="swistrack_tf_broadcaster" pkg="swistrack_broadcaster" type="tf_broadcaster" output="screen">
86 <rosparam command="load" file="$(find lse_miniq_bringup)/settings/initial_poses.yaml" />
87 </node>
88
89 <!-- Map server -->
90 <node name="map_server" pkg="map_server" type="map_server" args="$(find isr_maps)/maps/lse_empty_arena.yaml" output="screen"></node>
91
92 </launch>
Its similar to the previous example, only now we are also starting the map server with a map of the LSE arena plus a node to use the data from swistrack to publish the tf between the odometry of each LSE miniQ and its global pose in terms of the global frame, "/map".
Test using rviz
Open rviz:
rosrun rviz rviz
Load the configuration file located at /lse_miniq_robot/lse_miniq_bringup/multi_miniq.vcg. You should have the following rviz window:
You can give goals to your robots using the "2D Nav Goal" button. Don't forget to change the "2D Nav Goal -> Topic" field depending on the robot you want to move.
And that's it! Your LSE miniQs are working! Have fun developing and testing those olfactory swarming algorithms!