offjangir / zebu_assignment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Completing Zebu Intelligent Systems Assignment for Full Time Position

Follow the Instructions for Setting Up and running the code. Make sure you have the right version of Ubuntu i.e Ubuntu 20.04 with ROS Noetic.

Setting Up the Simulator - PX4 with Gazebbo Classic

After setting up PX4 with Gazebo classic Source paths in Bashrc

  • Open a new terminal and type:
sudo gedit ~/.bashrc
  • Add the following lines to the file that opens:
source ~/catkin_ws/devel/setup.bash
source ~/catkin_ws/src/PX4-Autopilot/Tools/setup_gazebo.bash ~/catkin_ws/src/PX4-Autopilot/ ~/catkin_ws/src/PX4-Autopilot/build/posix_sitl_default
export ROS_PACKAGE_PATH=ROS_PACKAGE_PATH:~/catkin_ws/src/PX4-Autopilot
export ROS_PACKAGE_PATH=ROS_PACKAGE_PATH:~/catkin_ws/src/PX4-AutopilotTools/sitl_gazebo

Install Apriltag ROS for Pose Estimation and tag detection

Some Other Changes which are required

  • Replace the iris_fav_cam model in PX4-Autopilot/Tools/simulation/gazebo_classic/models with model in /models.
  • Replace the config in apriltag_ros with configs in /configs
  • Please redirect approprite camera feed topic as per your convinience in Apriltag_ros launch files.(Topic : /iris/usb_cam, Launch File: continuous_detection.launch)
  • Build workspace
catkin build

Finally build the workspace

  • launch mymav.launch
roslaunch zebu_assignment mymav.launch
  • Run Question1_2.py : By default Question 2 shows functionalities of 1 and 2 So the Spral function is already on. Please Uncomment Sprial_trej() in case not requied. We can increase the pitch length of spiral after which it comes back home, following spiral trejectory till infinity in single loop would be weird so I have added this fuctionality of controlling for how long it follows spiral trej.
python3 Question1_2.py
  • For running Q3 first Run Detection stack for Tag:
ROS_NAMESPACE=/iris/usb_cam rosrun image_proc image_proc

In another Terminal:

roslaunch apriltag_ros continuous_detection.launch
  • Run Quesion3.py : The drone goes to a point where it can see the tag and then tries to land on the tag. A separate class implements a PD controller that uses the detected pose to land.(The pose has high noice due to camera calibration not performed So current performace is subpar)
python3 Question3.py

Something beyond assignment

About


Languages

Language:Python 52.5%Language:CMake 47.5%