Code Monkey home page Code Monkey logo

ros2_offboard_drone_control's Introduction

Hi there 👋

I am a robotics engineer with a passion for solving complex challenges using cutting-edge technology.

Check out my project portfolio for some of my robotics/engineering projects. https://marnonel6.github.io/

I received my Bachelor's degree in Mechatronic Engineering from Stellenbosch University and am currently pursuing a Master's degree in Robotics from Northwestern University. My studies have included significant coursework in embedded systems, machine learning, robotic manipulation, machine dynamics, sensing, and navigation. As an engineer, I enjoy working on challenging projects that combine multiple disciplines, from mechanical design and control systems to software development.

My most notable project involved programming a quadruped robot dog with voice and object recognition for navigation, aimed at assisting visually impaired individuals. My experience includes leading a team of four in developing a Python ROS2 package for a 7-DOF robot arm to autonomously play air-hockey. I also designed, built, and tested a thrust vector controlled scaled rocket, including implementing a PID controller and a state machine for autonomous active orientation control in-flight and recovery. Additionally, I have designed and built an unmanned aerial vehicle with a Pixhawk Cube Orange flight computer and programmed a Raspberry Pi for autonomous control of an autonomous beverage cooler.

During my internships, I have worked with CranioTech, Inc., where I executed viability tests on a 3D orthodontic surgery software for implant design and created 3D patient-specific implants through titanium 3D printing. At Seedmaster, Inc. and Raven, Inc., I collaborated with the assembly team to assemble an autonomous robotic farming platform and conducted uphill seeding field testing on the autonomous platform for data collection. At Bronberg Dynamics (Pty), Ltd., I programmed a PID controller for turbine blade orientation and devised, constructed, and tested a low-cost functional prototype single-blade wind turbine for remote environments to improve electricity security.

My skills include programming in Python, C++, C, Bash, R, and Assembly Language. In robotics, I have experience with ROS2/(ROS), Gazebo, MoveIt, Machine Learning, OpenCV, SLAM, Computer Vision, Control systems design, and Embedded systems. Additionally, I have expertise in manufacturing using Inventor, Fusion360, OnShape, SolidWorks, Rapid Manufacturing, Machining, EAGLE, KiCAD, and PCB Design. I am proficient in Linux, Git, CMake, Unit Testing, Ardupilot, and MATLAB software.

My GitHub Stats

ros2_offboard_drone_control's People

Contributors

marnonel6 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

ros2_offboard_drone_control's Issues

Order new parts

Received:

  • RPi
  • RFID system

Ordered:
-Drone electronics, FC, RTK, etc.

  • Electronics for charging circuit

Order:

  • SSD and SSD Hub

Communicatin between Pi and Pixhawk

SETUP PX4 (Pixhawk 6X) → RPI 4B Ubuntu ROS connection:
https://docs.px4.io/main/en/companion_computer/pixhawk_rpi.html (MAIN ONE)
https://docs.px4.io/main/en/companion_computer/pixhawk_companion.html#serial-port-setup

Image

UART MAVLINK

https://discuss.px4.io/t/controlling-pixhawk-6c-with-raspberry-pi-4b/30712/8?u=marnonel6
I had connection problems with the Pixhawk 6c too. In my case, I was able to solve them by setting
• MAV_1_RADIO_CTL to disabled and
• MAV_1_FLOW_CTRL to force off
See here 13 for the complete description.
THIS PARAMETER DOES NOT SHOW UP!!!sudo
UXRCE_DDS_CFG = 0 (Disabled) (https://github.com/PX4/PX4-Autopilot/releases/tag/v1.14.0-rc1) In a pre-release

sudo mavproxy.py --master=/dev/serial0 --baudrate 57600

Outcomes

I can see the connection over UART is working

Set turns (Fields2Cover) discretization

Problem

Currently the function path_dubins_cc.serializePath(3); does not change the actual path, but creates a string that can be saved to .csv.

Soluition

Choices:

  • Make a PR that changes the original Path
  • Write some logic to skip steps if it is to close. Reason for this is there is A LOT of points on a turn making a turn VERY slow.

Pose tolerance waypoints

Currently only checking if the 3D position is in an Euclidean tolerance.

Add

Check if yaw is in tolerance [Deg] before sending next waypoint.

Arming does not always work

Problem

When setting off-board control and arming the drone the drone does not always get armed and then the code just hangs.

Solution

Add code that reads the drone stage and if the drone was not armed and set to off-board then do it again. If this does not work for X amount of tries then Error and stop everything.

Base drone design improvements

Requirements:

  • Drone without payload 5kg @50% throttle/thrust
  • Flight time 35-45min
  • Payload 2kg with a minimum flight time of 20min with throttle <=80%
  • Space underneath drone for package delivery system

Possible improvement parts:

  • Motors -> ESC -> Battery
  • Frame change to a HexaCopter (6 Motors - Can maybe use the current motors and buy two more)
  • New flight computer VOXL2, Pixhawk 6C, 6X or 6X with RPi compute module.
  • NVIDIA Jetson Orin™ NX 16GB -> Will have support for 22.04 in Jetpack 6 release in Q3 2023.

Take-off modularity

TODO

  • Create take-off position -> Current possition and 5m altitude

  • Set take-off angle to be current drone angle

Takeoff and Smooth Takeoff functions

Problem

Arming and off-board control does not always work.

Current implementation

Wait some time (1second I think) then arm and switch to off-board control.

Proposed solution

Wait 1 second then arm the drone and subscribe to the drone mode status and see if the drone is armed and that it is off-board mode if it is not then wait 1 second again and retry. Have a max number of retries say 5 then if it still is not armed then stop everything and indicate that drone does not want to arm.

Explore Xavier

Username: Pegasus
Password: ?

Xavier Running:

  • Ubuntu 20.04
  • ROS2 Galactic - With a ROS bridge

Upgrade to:

  • NVIDIA Jetson Orin™ NX 6-16GB -> Will have support for 22.04 in Jetpack 6 release in Q3 2023.

Drone Electronic Schematic

Full electronic schematic of drone and charging hub

  • High level connections: Inkscape with photos
  • Electronic design of charging circuit and PCB: KiCad

Prefight: Crash dumps on SD

Problem

I am trying to tune my drone's PID controllers indoors in a custom rig that I built. I have PX4 v1.14-rc, but I keep getting the error in the images below. I have all the sensors calibrated.

I can't arm the drone and the M8N GPS is flashing red on the drone's fast and continuously. I think that is just because it does not have a GPS lock, because I'm indoors.

When I try to arm the drone with the remote control it only makes a sound, but does not arm.

I am building and uploading the banch release/v1.14 and I tried release/beta -> v1.14.0-rc2

Image

Image

Image

Tune Drone PID controls

Currently the drone has unstable flight. It Yaw's continuously and drifts in pitch and roll.

Problem with community help

PX4 forum post with logs

Dronecode foundation Discord chat:
Image

Image

Key points from suggestions:

  • Mechanical vibrations/resonance introduced by loose landing gear or soft flight controller dampers
  • PID not tuned at all

Suggested solutions

  • Cable tie around FC dampers to make it more rigid
  • Make sure no cable is to stiff on the FC and pulling it
  • Tune PID gains
  • Increase proportional gain for yaw and roll rate controller

Function for path discretization

Add a function for path discretization between any two points in a straight line. This will help with flying the drone to and from the start and end of the Fields2Cover path and also back to home or takeoff smoothly.

Get YOLO to work on Lamda

Install and setup YOLOv8 training environment for Ubuntu 22.04 and CUDA >=12.1

Steps:

  1. pip install ultralytics
  2. pip3 install torchvision==0.16
  3. pip3 install torch==2.1
  4. pip3 install torchaudio

CLI YOLO interface

Python interface

# Train with Python
from ultralytics import YOLO

# Load a model
model = YOLO('yolov8n.pt')  # load a pretrained model (recommended for training)

# Train the model
results = model.train(data='<path_to_dataset>/data.yaml', epochs=300, imgsz=640)

Fix: has no member named ‘discretize_swath’

Error

/home/marno/Classes/Final_project/Drone_feedlot_precision_farming/osprey/src/precision_farming_drone/drone_control/src/path_planning.cpp: In member function ‘void PathPlanning::path_planning()’:
/home/marno/Classes/Final_project/Drone_feedlot_precision_farming/osprey/src/precision_farming_drone/drone_control/src/path_planning.cpp:153:43: error: ‘using F2CPath = struct f2c::types::Path’ {aka ‘struct f2c::types::Path’} has no member named ‘discretize_swath’
153 | F2CPath new_path = path_dubins_cc.discretize_swath(discretize_step_size);
| ^~~~~~~~~~~~~~~~
gmake[2]: *** [CMakeFiles/path_planning.dir/build.make:76: CMakeFiles/path_planning.dir/src/path_planning.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:165: CMakeFiles/path_planning.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Analyze the Pegasus build and design choices

  • Thrust is not enough. @50% throttle only 4kg of thrust - drone is currently 2.3kg with a flight time of 28min
  • Increasing the weight will drastically decrease the flight time. @5kg the drone will be at 85% throttle just for hovering with a flight time of <10min probably.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.