ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Multi-vehicle communication in ROS2 and PX4

asked 2022-08-01 03:10:34 -0500

sbhoopat gravatar image

Hello everyone,

I'm currently working on a project to simulate a cooperative UAV-UGV system. Simply put, I want the UAV to send location coordinates of a visual target to the UGV, which will then relocate to the specified location. I'm having trouble figuring out how to establish communication between multiple vehicles and would greatly appreciate any help/advice!

So far, I have a UAV model set up for simulation with PX4 and Gazebo 11. I'm running Ubuntu 20.04 with ROS2 Foxy. I'm also using the darknet_ros package to enable computer vision to identify the visual target. The darknet_ros package is currently set up with pre-trained weights from VOC and COCO datasets. So, my current target is just a stop sign that comes default with Gazebo. I was able to get the PX4-ROS2 microRTPS Bridge working. So, I'm able to detect the stop sign in YOLO using the darknet_ros package.

My main question is, how do I go set up the UAV to send a target's location coordinates to the UGV? I used the .sh script that starts multi-vehicle simulation in PX4. But this doesn't solve my problem. After going through some ROS1 examples of others doing this, I thought of an idea. I thought I could set up a ROS2 launch file that spawns a UAV and UGV in Gazebo, starts two PX4 instances for each vehicle, and sets up a MAVROS node for the UAV and one for the UGV. Then maybe I could send the location coordinates through MAVROS. I was able to set up a ROS2 launch file that starts PX4 and spawns a UAV, and YOLO also starts up with it. But I'm stuck at this point and feel like maybe I'm taking the wrong approach. MAVROS also seems to be unstable for ROS2, should I use a ROS1-ROS2 bridge, then?

I'm new to ROS2 development and have only been learning for a couple months now, I would appreciate any advice or links to resources! Thanks in advance, everyone!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-01-04 10:55:16 -0500

mamado gravatar image

Why don't you use the PX4-ROS2 bridge for the rover as well?

PX4(UAV) -> uRTPS client (UAV) -> uRTPS agent -> ROS topic -> uRTPS agent -> uRTPS client (UGV) -> PX4(UGV)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-08-01 03:10:34 -0500

Seen: 447 times

Last updated: Jan 04 '23