系统环境
配置工作空间
$ mkdir -p ~/catkin_ws/src
$ cd ~/catkin_ws/src
$ git clone https://github.com/ethz-asl/rotors_simulator.git
$ git clone https://github.com/ethz-asl/mav_comm.git
$ sudo apt install ros-melodic-octomap-msgs ros-melodic-octomap-ros libgoogle-glog-dev ros-melodic-joy python-catkin-tools python-pygame
编译
$ cd ~/catkin_ws/
$ catkin init # If you haven't done this before.
$ catkin build
$ echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
运行
$ roslaunch rotors_gazebo mav_hovering_example.launch mav_name:=firefly world_name:=basic
$ roslaunch rotors_gazebo mav_with_keyboard.launch mav_name:=firefly world_name:=basic
发送命令
$ rostopic pub /firefly/command/motor_speed mav_msgs/Actuators '{angular_velocities: [100, 100, 100, 100, 100, 100]}'