Skip to content

Commit

Permalink
Updating the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
malintha committed Dec 9, 2021
1 parent beb1488 commit 03117e9
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,28 @@ Run the simulator
source devel/setup.bash
roslaunch multi_uav_simulator simu.launch

**Adding a new drone to the environment**

SwarmSim2 uses xacro to spawn new models into the simulation environment. Out of the box, it has 5 drones in the environment. If you need to add a sixth drone, simply follow the steps below.

1) In the `launch/simu.launch` file, add a new line with the corresponding drone id. Make sure to change `<param name>` and the robot_id accordingly. For example,

<param name="cf6" command="$(find xacro)/xacro --inorder $(find multi_uav_simulator)/cf_description/crazyflie.urdf.xacro robot_id:=6" />


2) In order to specify the initial conditions for the robot add a new block in the `config.yaml` file as below.

robot_6:
position: [2, 4, 0]
velocity: [0, 0, 0]
rotation: [1, 0, 0, 0, -0.9995, -0.0314, 0, 0.0314, -0.9995]
omega: [0, 0, 0]

The rotation and omega stands for the initial rotation matrix (3x3) and the angular velocity (3x1) of the rigid body. Here, we initialize the drone up-side down. To make it right way up, change the rotation matrix to `[1, 0, 0, 0, 1, 0, 0, 0, 1]`.


3) Finally, to visualize the newly added drone, add a robot_model visualization type to RViz. Change its description to corresponding param name of the newly added element in the launch file. i.e.: "`cf6`".

[1] Our work based on this controller:

@inproceedings{fernando2019formation,
Expand All @@ -48,26 +70,3 @@ Run the simulator
year={2010},
organization={IEEE}
}


**Adding a new drone to the environment**

SwarmSim2 uses xacro to spawn new models into the simulation environment. Out of the box, it has 5 drones in the environment. If you need to add a sixth drone, simply follow the steps below.

1) In the `launch/simu.launch` file, add a new line with the corresponding drone id. Make sure to change `<param name>` and the robot_id accordingly. For example,

<param name="cf6" command="$(find xacro)/xacro --inorder $(find multi_uav_simulator)/cf_description/crazyflie.urdf.xacro robot_id:=6" />


2) In order to specify the initial conditions for the robot add a new block in the `config.yaml` file as below.

robot_6:
position: [2, 4, 0]
velocity: [0, 0, 0]
rotation: [1, 0, 0, 0, -0.9995, -0.0314, 0, 0.0314, -0.9995]
omega: [0, 0, 0]

The rotation and omega stands for the initial rotation matrix (3x3) and the angular velocity (3x1) of the rigid body. Here, we initialize the drone up-side down. To make it right way up, change the rotation matrix to `[1, 0, 0, 0, 1, 0, 0, 0, 1]`.


3) Finally, to visualize the newly added drone, add a robot_model visualization type to RViz. Change its description to corresponding param name of the newly added element in the launch file. i.e.: "`cf6`".

0 comments on commit 03117e9

Please sign in to comment.