Skip to content

Latest commit

 

History

History
106 lines (75 loc) · 2.75 KB

README.md

File metadata and controls

106 lines (75 loc) · 2.75 KB

Robotics-Project

Dependencies

Install Ardupilot from here

Setup ardupilot-gazebo link from here

Setup catkin workspace

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

Import models

Add the Open Gazebo Models Database

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

Import the new Husky model (with the Aruco marker)

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

How to Run

1. Initiate animation in gazebo

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

2. Start Tracking

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

3. To view the Tracking

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

Plotting the Errors

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