- ROS-melodic
- Gazebo
- SITL
- Ardupilot-gazebo link
- The Husky Rover gazebo package
Install Ardupilot from here
Setup ardupilot-gazebo link from here
To start working with ros, you need to setup ROS workspace using catkin. Open up a terminal to setup the base directory.
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws
catkin_make
Once done, clone this repo inside catkin_ws/src,
cd ~/catkin_ws/src
git clone https://github.com/akj127/Robotics-project
Use git to get a bunch of open source gazebo models from the Open Source Robotics Foundation (OSRF)
Also, add the models directory to the GAZEBO_MODEL_PATH
cd ~/
git clone https://github.com/osrf/gazebo_models.git
echo 'export GAZEBO_MODEL_PATH=~/gazebo_models:${GAZEBO_MODEL_PATH}' >> ~/.bashrc
source ~/.bashrc
The new Husky model can be found in the models
directory of this repo. Simply replace the original Husky model with this updated model. To do that you would need sudo priveleges
sudo cp ~/catkin_ws/src/Robotics-project/models/tagged_husky/husky.urdf.xacro $(catkin_find husky_description/urdf)/
Model taken from here
Open a new terminal and enter following command,
export GAZEBO_RESOURCE_PATH=~/catkin_ws/src/drone_rover/worlds/
roslaunch husky_gazebo husky_empty_world.launch world_name:=robo.world
Now gazebo should be launched, and a world consisting of rover, drone should be visible open new terminal,
sim_vehicle.py -v ArduCopter -f gazebo-iris --console --map
In a new terminal (python 2.7)
The ports are generally either 14550
or 14551
.
cd ~/catkin_ws/src/drone_rover/dronekit/
python drone_move.py --connect 127.0.0.1:14550
In a new terminal
rqt
Alternatively you can run the script below to execute all the 3 steps
cd ~/catkin_ws/src/drone_rover/
bash run.sh
Note: If image is not appearing in rqt go into Plugins -> Visualization -> Image View
For steering the rover: Plugins -> Robot Tools -> Robot Steering
In a new terminal (python 3.5+)
cd ~/catkin_ws/src/drone_rover/dronekit/
python3 plot_error.py
A video of the working model can be viewed here