[Documentation] [TitleIndex] [WordIndex

QUADROTOR SIMULATION IN GAZEBO

1. Go and download hector quadrotor package using command

sudo apt-get install ros-hydro-hector-quadrotor

This will install all the packages required not for slam. For hector slam install

sudo apt-get install ros-hydro-hector-quadrotor-demo

2.Make sure you are using your distro,i.e, hydro or indigo or jade, what ever in the place of hydro in the above commands.

3. If you want to install from source, incase if you haven't install wstool then do this

sudo apt-get install python-wstool

then get the packages using wstool

mkdir ~/hector_quadrotor_tutorial
cd ~/hector_quadrotor_tutorial
wstool init src https://raw.github.com/tu-darmstadt-ros-pkg/hector_quadrotor/hydro-devel/tutorials.rosinstall

4.dont forget to build using catkinmake and source the setup.bash

catkin_make
source devel/setup.bash

5.If you want to try using the urdf of the hector package

roslaunch hector_quadrotor_gazebo quadrotor_empty_world.launch

6. There are also different urdfs like with laser, with kinect in the same package hector_quadrotor_gazebo. you can spawn them in your world and use them.

7. If you want to control the position of the quadrotor, go to the control.lauch

roscd hector_quadrotor_controller
cd launch
gedit controller.launch

8.Add controller/pose to the args then it should look like

  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false" output="screen" args="controller/pose controller/twist  --shutdown-timeout 3"
  />

9. then the pose controller will be initiated once you start the urdf, which starts these controllers 10. Try giving some position like this

rostopic pub -1 /command/pose geometry_msgs/PoseStamped '{ header: { frame_id:  "/base_footprint"}, pose: { position: { x: 3, y: 2, z: 2}, orientation: { x: 0, y: 0, z: 0, w: 1 } } }'

you will see the quadrotor going to that position

10.There is also velocities control using the topic cmd_vel, which is of type geometry_msgs/Twist. Try publishing that kind of message as with some velocities

rostopic pub -r 10 /cmd_vel geometry_msgs/Twist '{linear:  {x: 1.0,y: 1.0, z: 3.0}, angular: {x: 0.1,y: 0.1,z: 0.1}}'

2024-11-16 14:45