/robotics-resources

Resource for various robotics project

robotics-resources

Various robotics resources:

=============== UAV-Planners ===============

Ego-planner: git; Ego-planner-swarm: code

Agile_autonomy: git

mader: git

faster: Git

sb_min_time_quadrotor_planning: Git

kr_autonomous_flight: Git

=============== VIO ===============

=========== SLAM ===========

ORB_SLAM2: git

=========== MAVROS ===========

Getting Started with PX4 Mavros: Instructions

Getting Started with Ardupilot Mavros: Instructions, all

Mission Planner: Installation

MAVSDK-Python: git_installation

How to add a ROS camera to IRIS for gazebo simulation? answer

Some simple mavros scripts: Matny’s git

=========== Flight Controller ===========

Ardupilot

Debuging: balance-out-while-lifting

Note:

Short the pin for in-built compass

=========== Control System ===========

data-driven-dynamics: ETH Git Code

=========== GUI ===========

List of Web Tools for ROS Robots: blog/web page

=========== IOD ===========

ROSLink: git

CloudStation: Git, Tutorial

UG-One: Git

WebODM: Git

ros_dronemap: Git

drone-cloud-platform3.0: Git

Cloud-Controlled-4GLTE-Drone-GCS: Git

Dronekit/tower-web: Git

GCS-uno: Git, Tutorial, Git

Azure Cloud Services for DJI Drones: blog

=========== Drone Specific ===========

Clover: About, Setup

=========== Courses ===========

Aerial Robotics Course from HKUST: drive

=========== Computer Vision ===========

--------- Object Detection ---------

https://blog.roboflow.com/how-to-train-yolov6-on-a-custom-dataset/), blog2), {Recommended}Yolov7(git, tutorial, colab), Walt More resources: 1, 2, 3

Usecase:

Construction(1,2,3,4)

Helmet-Detection

Test Video - 1, 2, 3
Paper: 1
Github: all, 1, 2, 3, 4

Fire: 1,2,3, 4

Leaf Health and Disease: Data[1,2,3,4], Paper[1,2,3,4], Test Video[1,2,3,4], Code[Git, 1,2,3_matlab,4, 5 more]

Object counting: one-tab

--------- Object Tracking ---------

Blogs: #1, #2, #3, #4

Sort: Git, Paper

Deep-Sort: Git, Paper

ByteTrack: Git, Paper

=============================================

ROS DRONE Package Installation, Debuging and Runing

=============================================

===Install Mavros and relavent Packages===

Binary

sudo apt-get install ros-$ROS_DISTRO-mavros ros-$ROS_DISTRO-mavros-extras  
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh  
sudo bash ./install_geographiclib_datasets.sh  

Or from Source

=> https://github.com/mavlink/mavros  
git clone https://github.com/mavlink/mavros.git  

ERROR: missing geometric_controller or mavros_controllers

git clone https://github.com/Jaeyoung-Lim/mavros_controllers.git

???

https://github.com/HKUST-Aerial-Robotics/mockasimulator

------------ Mavros/PX4-Autopilot debuging ------------

e.g unable to take off
rosrun mavros checkid
rostopic echo /mavros/state
rostopic echo -n 1 /mavros/state
rostopic echo -n 1 /diagnostics

ERROR: Unknown model iris_depth_camera (not found by name on

cd workspace/src cp Fast-Planner/storage/1024_iris_depth_camera ~/.ros/etc/init.d-posix/airframes/1024_iris_depth_camera ??mzahana sudo apt install ros-noetic-multi-map-server

=== Building PX4-Autopilot (Ubuntu18) ===

cd /home/rajendra/
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
cd PX4-Autopilot/  
DONT_RUN=1 make px4_sitl_default gazebo

Error 1. No module future in "from future import standard_library"

pip3 install future

Error 2. No delopment/mavlink.h

cd PX4-Autopilot/Tool/sitl-gazebo git checkout 6fa6ec78a7a1619b7b90ac0c01aaec919defbe35

Error 3. submodule changed=> y(to run with this version)

Error 4.?? Check requirments

cat PX4-Autopilot/Tools/setup/requirements.txt cat PX4-Autopilot/src/lib/events/libevents/requirements.txt

Error 5. CMake Error: GSTREAMER_APP_LIBRARIES Variable NOTFOUND.

=> sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

Error 5. UAS: GeographicLib exception: File not readable /usr/share/GeographicLib/geoids/egm96-5.pgm.

sudo ./mavros/scripts/install_geographiclib_datasets.sh

cd PX4-Autopilot/
DONT_RUN=1 make px4_sitl_default gazebo
source ~/catkin_ws/devel/setup.bash    # (optional)
source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo
roslaunch px4 posix_sitl.launch

------------ Universal Source technique

source ~/.bashrc
source /opt/ros/noetic/setup.bash
source ~/drone_ws/devel/setup.bash
source ~/PX4-Autopilot/Tools/setup_gazebo.bash ~/PX4-Autopilot ~/PX4-Autopilot/build/px4_sitl_default
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:~/PX4-Autopilot/Tools/sitl_gazebo

------------

?? PX4 version: v1.13.0-alpha1-3027-geade2915c1

=========== PX-Avoidance ===============

cd PX-Avoidance
roslaunch local_planner local_planner_stereo.launch  
rosrun mavros mavsys mode -c OFFBOARD
rosrun mavros mavsafety arm
rosrun mavros mavsys mode -c OFFBOARD

============= Ardupilot ===============

Linux

Installation: https://ardupilot.org/dev/docs/building-setup-linux.html
Setting up SITL on Linux: https://ardupilot.org/dev/docs/setting-up-sitl-on-linux.html

built

cd ~/drone_ws/ardupilot
./waf configure --board sitl

configure

cd ~/drone_ws/ardupilot/ArduCopter
sim_vehicle.py -w (once)

run

sim_vehicle.py --console --map  

/home/rajendra/drone_ws/ardupilot/Tools/autotest/sim_vehicle.py -v ArduCopter --no-extra-ports -I 0 --out=udp:54.161.56.169:14550

/home/rajendra/drone_ws/ardupilot/Tools/autotest/sim_vehicle.py -v ArduCopter --console --map --no-extra-ports -I 0 --out=udp:54.161.56.169:14550

============= Orignal fast-planner ==============

T1

source devel/setup.bash && roslaunch plan_manage rviz.launch

T2

source devel/setup.bash && roslaunch plan_manage kino_replan.launch

=============== Beomsu7's fast-planner =================

https://github.com/beomsu7/Fast-Planner

T1

roslaunch plan_manage px4_sitl_kino_replan.launch

T2

rosrun mavros mavsafety arm

T3

rosrun mavros mavsys mode -c OFFBOARD

Give the goal in rviz

================ Mzahana's fast-planner =================

https://github.com/mzahana/px4_fast_planner

T1

roslaunch px4_fast_planner px4_fast_planner.launch

T2

rostopic pub --once /move_base_simple/goal geometry_msgs/PoseStamped "header:
  seq: 0
  stamp:
    secs: 0
    nsecs: 0
  frame_id: ''
pose:
  position:
    x: 19.0
    y: 15.0
    z: 3.0
  orientation:
    x: 0.0
    y: 0.0
    z: 0.0
    w: 1.0"

Error: inotify_add_watch("/home/rajendra/.config/ibus/bus/cf071f50b0c74016a868d5634bb32107-unix-0") failed: "No space left on device"

echo fs.inotify.max_user_watches=65536 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
https://askubuntu.com/questions/1088272/inotify-add-watch-failed-no-space-left-on-device 
https://blog.csdn.net/Changer_sun/article/details/79212313

============ Fast Planner ERROR ===========

Triggered!
[TRIG]: from WAIT_TARGET to GEN_NEW_TRAJ
[kino replan]: -----------------------
start:  -0.0112145 -0.00287183 -0.00545828, -0.00900632 -0.00325972  -0.0105637, 0 0 0
goal:0 0 1, 0 0 0
[fast_planner_node-2] process has died [pid 99980, exit code -11, cmd /home/rajendra/drone_ws/devel/lib/plan_manage/fast_planner_node /odom_world:=/mavros/local_position/odom /sdf_map/odom:=/mavros/local_position/odom /sdf_map/cloud:=/pcl_render_node/cloud /sdf_map/pose:=/mavros/local_position/pose /sdf_map/depth:=/d435/depth/image_rect_raw __name:=fast_planner_node __log:=/home/rajendra/.ros/log/cf8b4932-4483-11ec-a2f0-cf1b4db027f8/fast_planner_node-2.log].
log file: /home/rajendra/.ros/log/cf8b4932-4483-11ec-a2f0-cf1b4db027f8/fast_planner_node-2*.log

=================== Vins-fusion ============

https://github.com/HKUST-Aerial-Robotics/VINS-Fusion

---------- Run ----------

---------- Run with Bagfile ----------

cd drone_ws/
### Open 4 terminals, and run each.
source devel/setup.bash && roslaunch vins vins_rviz.launch  

source devel/setup.bash && rosrun vins vins_node ~/drone_ws/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml 

source devel/setup.bash && rosrun loop_fusion loop_fusion_node ~/drone_ws/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml 

source devel/setup.bash && rosbag play bagfiles/MH_04_difficult.bag  

---------- Run with Realsense d435 ----------

source devel/setup.bash && roslaunch vins vins_rviz.launch  

source devel/setup.bash && rosrun vins vins_node ~/drone_ws/src/VINS-Fusion/config/realsense_d435i/realsense_stereo_d435_config.yaml  

source devel/setup.bash && rosrun loop_fusion loop_fusion_node ~/drone_ws/src/VINS-Fusion/config/realsense_d435i/realsense_stereo_d435_config.yaml  

source devel/setup.bash && roslaunch vins rs_camera_d435.launch  

---------- Vins Installation & Error ----------

1. Clone

cd ~/drone_ws/src
git clone https://github.com/HKUST-Aerial-Robotics/VINS-Fusion.git
cd ../

2. Download and Install ceres-solver

sudo apt-get install cmake  
sudo apt-get install libgoogle-glog-dev libgflags-dev  
sudo apt-get install libatlas-base-dev  
sudo apt-get install libeigen3-dev  
sudo apt-get install libsuitesparse-dev  

http://ceres-solver.org/ceres-solver-2.0.0.tar.gz
cp ~/Downloads/ceres-solver-2.0.0.tar.gz .
tar zxf ceres-solver-2.0.0.tar.gz
mkdir ceres-bin
cd ceres-bin
cmake ../ceres-solver-2.0.0
make -j3
make test
sudo make install

3. Build

catkin_make

4. Errors(Ubuntu20.04)

if error: /usr/include/eigen3/Eigen/SVD:35:10: fatal error: src/SVD/UpperBidiagonalization.h: No such file or directory

i.e missing /usr/include/eigen3/Eigen/src/SVD UpperBidiagonalization.h
pkg-config --modversion eigen3 
=> sudo apt install libeigen3-dev --reinstall #even if to newest version still reinstall

error: ‘integer_sequence’ is not a member of ‘std’

https://github.com/colmap/colmap/issues/905
https://programmerah.com/solved-ceres-compile-error-integer_sequence-is-not-a-member-of-std-31728/
https://stackoverflow.com/questions/17424477/implementation-c14-make-integer-sequence
My ErrorLog.txt => https://gist.github.com/iamrajee/6e43d88e65214f2fa96a30d3dcb365bb
Solution (c++11 => c++14) in:
cd ~/drone_ws/src/VINS-Fusion
code camera_models/CMakeLists.txt  
code global_fusion/CMakeLists.txt  
code loop_fusion/CMakeLists.txt   
code vins_estimator/CMakeLists.txt  

Error: Segmentation Fault

rosrun vins vins_node ~/drone_ws/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml
=> Segmentation Fault
https://github.com/HKUST-Aerial-Robotics/VINS-Fusion/issues/134
https://github.com/HKUST-Aerial-Robotics/VINS-Fusion/issues/106#issuecomment-864415677
https://github.com/mrdavoodi/VINS-Fusion/commits/master

cd ~/drone_ws/src/VINS-Fusion

code camera_models/include/camodocal/calib/CameraCalibration.h
https://github.com/mrdavoodi/VINS-Fusion/commit/0e50050be32a8a5292b862fa86a605e3adf6761e  

code camera_models/include/camodocal/camera_models/Camera.h
https://github.com/mrdavoodi/VINS-Fusion/commit/fc3f3ccd1786dec1fe73baeb2900a8992ee3cc65  

code camera_models/include/camodocal/chessboard/Chessboard.h
https://github.com/mrdavoodi/VINS-Fusion/commit/0461b57850d5b5393b9476950f883178670a71b9  

code loop_fusion/src/ThirdParty/DVision/BRIEF.h
https://github.com/mrdavoodi/VINS-Fusion/commit/37144c454117092baac22818caf9c8e33c7e66f0  

ERROR: fatal error: opencv2/imgcodecs/legacy/constants_c.h: no such file or directory ros

Because using old version of opencv  
https://github.com/opencv/opencv/issues/13201  
https://github.com/opencv/opencv/pull/13253/commits/562676c5dae4d25b00f88556bd8de99330d4e484  
https://github.com/raulmur/ORB_SLAM2/issues/782  
https://answers.ros.org/question/225229/error-opencv2imgcodecshpp/  

#### Solution 1. Tried didn't work
cd /usr/include/opencv/modules/imgcodecs/include/opencv2/imgcodecs
sudo cp -r /usr/include/opencv4/opencv2/imgcodecs/legacy .
(But have to build again so aborded => mv legacy/ .legacy/)

#### Solution 2. Changing CV bridge opencv version older(3 or opencv) to newer(4)
cd /opt/ros/noetic/share/cv_bridge/cmake
code cv_bridgeConfig.cmake
=> din't work

#### Simple =>? removing that inclusion (#include "opencv2/imgcodecs/legacy/constancts_c.h").
Doesn;t either Works?

fatal error: development/mavlink.h: No such file or directory

https://github.com/PX4/PX4-SITL_gazebo/issues/823
cd ~/px4_ws/src/PX4-SITL_gazebo
git checkout 6fa6ec78a7a1619b7b90ac0c01aaec919defbe35

?? catkin_make

[100%] Linking CXX executable /home/rajendra/drone_ws/devel/lib/vins/vins_node
/usr/bin/ld: warning: libopencv_video.so.4.2, needed by /home/rajendra/drone_ws/devel/lib/libvins_lib.so, may conflict with libopencv_video.so.3.4
[100%] Built target vins_node

/media/rajendra/ab55e7ad-83d7-457b-874a-dc8d74f368cb/rajendra/drone_ws

ERROR: Tree not connect! (In this file to work with fast planer)

Changing Frame: "world" => "map"
code vins_estimator/src/utility/visualization.cpp  
code vins_estimator/src/estimator/estimator.cpp  
code loop_fusion/src/pose_graph.cpp  
code loop_fusion/src/pose_graph_node.cpp  
code global_fusion/src/globalOpt.cpp  
code global_fusion/src/globalOptNode.cpp  

========== rtab drone examples ===========

cd drone_ws/src  
https://github.com/matlabbe/rtabmap_drone_example  
git clone https://github.com/matlabbe/rtabmap_drone_example.git  
git clone https://github.com/SyrianSpock/realsense_gazebo_plugin.git  
cd ../  
./rosdep  
sudo apt install ros-noetic-teleop-twist-joy  
sudo apt install ros-noetic-imu-complementary-filter  
catkin_make  

roslaunch rtabmap_drone_example gazebo.launch  
roslaunch rtabmap_drone_example rviz.launch  
roslaunch rtabmap_drone_example slam.launch  
rosrun rtabmap_drone_example offboard  

??
rosrun teleop_twist_keyboard teleop_twist_keyboard.py  

===== Malintha rrt algo(Not Important) ======

=> https://github.com/Malintha, https://github.com/malintha/rrt-ros  
roscore  
rosrun rrt-planning rrt  
rosrun rviz rviz #add mark from available topic  

=============== XTDrone ============

sudo apt install ros-melodic-mavros-extras  
sudo apt install ninja-build exiftool ninja-build protobuf-compiler libeigen3-dev genromfs xmlstarlet libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev  
pip2 install pandas jinja2 pyserial cerberus pyulog==0.7.0 numpy toml pyquaternion empy pyyaml  
pip3 install packaging numpy empy toml pyyaml jinja2 pyargparse  
pip install --upgrade setuptools  
python -m pip install --upgrade pip  
sudo apt install ros-melodic-gazebo-*  
sudo apt-get install ros-melodic-camera-info-manager  

mkdir -p xtdrone_ws/src  
cd xtdrone_ws/src/  
git clone https://github.com/robin-shaun/XTDrone --recursive  

cp ~/drone_ws/*.sh .  
mkdir -p xtdrone_ws/src  
cd ~/xtdrone_ws$  
./rosdep.sh  

ERROR: Could not find a package controlConfig.cmake

=> roscd xtdrone_qt  
~/xtdrone_ws/src/XTDrone/coordination/formation_communication_demo  
sudo mv xtdrone_qt/ .xtdrone_qt/   

ERROR: Build error

=> catkin_make    
=> catkin_make_isolated    
=> catkin build  

ERROR: Catkin build not found

=> sudo pip install -U catkin_tools

ERROR: Could not find a package Qt5ChartsConfig.cmake

=> sudo apt install libqt5charts5-dev

ERROR: cannot find -lpose_utils

=> ???
https://stackoverflow.com/questions/16710047/usr-bin-ld-cannot-find-lnameofthelibrary

------------- RUN XTDrone -------------

cd ~/PX4-Autopilot  
roslaunch px4 indoor1.launch  
              OR  
roslaunch px4 mavros_posix_sitl_iris_0.launch  

cd ~/XTDrone/communication/  
python multirotor_communication.py iris 0  

cd ~/XTDrone/control/keyboard  
python multirotor_keyboard_control.py iris 1 vel  

================ KALIBR ============

Run

Realsense

-------- Record---------

cd ~/drone_ws/src/kalibr/aslam_offline_calibration/kalibr/python  
roslaunch vins rs_camera_d435.launch  
                 OR   
roslaunch depthai_examples stereo_node.launch  
rqt_image_view  

rosrun topic_tools throttle messages /camera/infra1/image_rect_raw 4.0 /cam0/image_raw  
rosrun topic_tools throttle messages /camera/infra2/image_rect_raw 4.0 /cam1/image_raw  
                                        OR
rosrun topic_tools throttle messages /stereo_publisher/left/image 4.0 /cam0/image_raw  
rosrun topic_tools throttle messages /stereo_publisher/right/image 4.0 /cam1/image_raw  

rosbag record /cam0/image_raw /cam1/image_raw  

-------- Calibrate---------

./kalibr_calibrate_cameras --target april_6x6.yaml --bag 2022-05-11-12-08-13_d435_gray.bag --models pinhole-radtan pinhole-radtan --topics /cam0/image_raw /cam1/image_raw

-------- Test with Vins---------

Install

Error

./kalibr_create_target_pdf --h

=> ImportError: No module named pyx
==>> sudo apt-get install python-pyx

ImportError: No module named sm

=> source devel/setup.bash

============= OAK ============

Could not find a package configuration file provided by "depthai"

cd ~/oak_ws/src/luxonis/depthai-ros  
sudo ./install_dependencies.sh  
cd ~/oak_ws/  
catkin_make --cmake-args -D depthai_DIR=/home/rajendra/oak_ws/depthai  
roslaunch depthai_examples stereo_node.launch  

================ QGC Installation =============

After downloading QGC.Image
sudo usermod -a -G dialout $USER
sudo apt-get remove modemmanager

=============== ROSDEP Error =================

rosdep: command not found
sudo apt install python-rosdep

========== Realsense Driver & SDK Install ============

https://robots.uc3m.es/installation-guides/install-realsense2.html

=============== PX4 VIO Demo ==============

source devel/setup.bash && roslaunch vins vins_rviz.launch
source devel/setup.bash && rosrun vins vins_node ~/drone_ws/src/VINS-Fusion/config/euroc/euroc_stereo_imu_config.yaml /vins_estimator/odometry:=/camera/odom/sample
source devel/setup.bash && rosbag play bagfiles/MH_04_difficult.bag

roslaunch px4_realsense_bridge bridge_mavros_sitl.launch
./QGroundControl.AppImage

==================== FUEL ===================

https://github.com/HKUST-Aerial-Robotics/FUEL

T1

source devel/setup.bash && roslaunch exploration_manager rviz.launch

T2

source devel/setup.bash && roslaunch exploration_manager exploration.launch