ROS2 and PX4 Tutorial | Simulated Offboard Mode
HTML-код
- Опубликовано: 19 июл 2024
- Braden Wagstaff walks us through a tutorial on utilizing ROS2 and PX4 in simulated offboard mode. This tutorial is designed for beginners and those who are new to ROS2 or PX4.
Changes To Tutorial Not Mentioned In Video:
Be sure to check the updated tutorial in the Github link below. Some changes to the tutorial not seen in the video are
-updated install scripts for PX4
-the video says to run colcon build in the /ros2_px4_offboard_example_ws/src folder but ROS2 should be built in the /ros2_px4_offboard_example_ws folder
Useful Links & Resources:
- Tutorial Code & Instructions: github.com/ARK-Electronics/RO...
- This example builds upon the work by Jaeyoung Lim: github.com/Jaeyoung-Lim/px4-o...
Please note, the content in the mentioned repository may undergo changes over time and may not always align perfectly with this video tutorial.
This tutorial is designed for Ubuntu 22.04 users and assumes the use of ROS2 Humble, following the PX4 docs as of June 2023.
Community & Collaboration:
- For PX4 and ROS2 assistance and collaboration, join the Dronecode community on Discord: / discord
Further Reading:
- PX4 Documentation: docs.px4.io/main/en/
- ROS2 Humble Documentation: docs.ros.org/en/humble/index....
About Us:
- For more information about us and our work, visit Ark Electronics: arkelectron.com/
Chapters
00:00 Introduction
00:51 GitHub
01:57 Setup
08:03 Offboard Example
10:52 Safe Gazebo Shutdown
11:37 Code Walkthrough
15:44 Outro Наука
Thanks for share it
Great work! thank you for the clarity!
Super helpful tutorial! Thanks!
This was helpful.
Fantastic Braden!!! Please, I'd like to know where I need to change to put a custom gazebo world in this code and record the flying using the RGB drone camera too?
Hi Braden. First of all, great video. I tried this and i got to the Gazebo Sim part. however i could not able to control the drone. Leaving that apart, i see that this simulation is done on Gazebo Sim7 with Ubuntu22.04 as OS and ROS2 Humble as node. I want to know whether instead of Gazebo Sim7, coulr we use Gazebo 11 or the latest version. I tried this but i got the makefile error. Is there some issues on ubuntu 22.04 regarding working of Gazebo
Hello do i need camera calibration to detect aruco markers using the camera of gz_x500_depth ?
Dear sir, if I want add some new world in the model test, how could i do it, i just follow the guide in the px4 guide, but it seems net work
Is any chance we can connect px4 to some custom aerial platform developed in moveit? So, basically px4 works as a flight computer with estimations and other kinds of stuff, but the dynamics of flying platform we develop by ourself.
I am trying to run this on Ubuntu 22 with ROS2 humble and everything start however the only velocity_control messages I see is "Arm Message: True" and "Arm Message; False" as I toggle with the space bar. There are no other messages. No action when I press the wsad keys.
Same issues, what we can do?
Followed everything as per the video but the drone simulation in Gazebo and rviz aren't responding to any keys and aren't flying either... Any suggestions on how to solve it please...
You need QGround Control open
@@immanuelampomahmensah7909 Can you explain more on how to do that? Thanks!
How can this be used for a real flight controller to get real-time data from say a Pixhawk Cube and be able to send commands to the Pixhawk Cube from ROS2? I've tried connecting to it but I've had no luck
I have to second this!! I have spent weeks trying to get my Cube Orange to connect to my host computer from the jetson nano with the new uXRCE-DDS the PX docs about the agent are very vague!!
@@wmlong777 Follow the instructions in the docs for building from source. Then on 1.14 or main PX4 set the param UXRCE_DDS_CFG to the port you want to use. On the companion computer run "sudo MicroXRCEAgent serial --dev /dev/AMA0 -b 921600" pointing to the serial port you are using.
docs.px4.io/main/en/middleware/uxrce_dds.html#micro-xrce-dds-agent-installation
docs.px4.io/main/en/middleware/uxrce_dds.html#starting-the-client
I have been stuck on this for couple of minutes until I realised the connection just needs some time. I followed docs on px4 site (linked above by @arkelectron). Used serial connection and nothing happened (my DDS agent didn't connect and topics were not created). I was searching around and turned out that after I left this setup for some time it finally managed to connect. It may be buggy or my setup was just slow. I used SiK Holybro telemetry radio (can't remember which version) as serial device, and other end of this radio was connected by USB to my laptop where I redirected this USB device to WSL2 instance using usb-ipd. On WSL2 then I started DDS agent and it worked like a charm, I could use ROS2 without cable connected to the flight controller (Pixhawk 6X).
Thank you so much for your interesting lesson! i wanna request you how can install or get "gz_x500"?. I use ubuntu 22.04, how it doesn't run command "make px4_sitl gz_x500". I appreciate you if you give me a response.
With ubuntu 22.04, after cloning PX4-Autopilot repository as described in the tutorial, gazebo garden is installed by default and all models including x500 (gz_x500) is automatically installed. Make sure to run the bash script for the gazebo to be installed as the tutorial says. Also it does run the command make px4_sitl gz_x500, but it is done through the processes.py file in the ros2 offboard package src
Can you please share a link showing the simulation for a ROS1 / gazebo / ubuntu / PX4 setup ....
This is only for ROS2.
@@arkelectron Can i install ROS2 in parallel to ROS1 setup as the first of having the PX4 from gitbub is the same for both ROS 1 and ROS 2 . please advice....thank you
But tragectory_setpoint msg seems to didn't work for fixed wing isn't it?
It appears that the fixed wing position controller supports trajectory setpoints in offboard mode.
github.com/PX4/PX4-Autopilot/blob/main/src/modules/fw_pos_control/FixedwingPositionControl.cpp#L2182-L2185
Hi, would this work with ROS2 Foxy? I am on Ubuntu 20.04
It should
Is it possible if i use wsl2?
You might be able to. I haven't tested it in wsl2.
I've used Windows 10 and wsl2- the 'make' process on px4_msgs and px4_comm packages wasn't done overnight.
For context, I used an 8GB RAM, 2.7GHz 4- cores computer. So, I just ended up switching the OS to Ubuntu 22.04 and it took only 30 minutes as it had in the past on a raspberry pi 4 8GB RAM
Hey I am getting
WARN [timesync] time jump detected. Resetting time synchroniser.
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
WARN [timesync] time jump detected. Resetting time synchroniser.
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
ERROR [sensors] Accel #0 fail: STALE!
continously after launching the ros2 launch file How to reolve this Same happened when I followed px4 docs
docs.px4.io/main/en/ros/ros2_comm.html
Me too and I don´t understand why. Can anyone help?