VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program
-
Hello,
I recently started working with a Starling drone with VOXL2 and ROS2, and I am having a bit of trouble trying to run a sample offboard program I found from the PX4 website. I followed the steps on the website to upload and run a program that allows the drone to send setpoints, enter offboard mode, arm, fly five meters into the air, and finally wait. However, when attempting to run the program, the default Figure 8 program on the drone runs instead. This is the link to the guide I followed: https://docs.px4.io/main/en/ros2/offboard_control.html
Additionally, I also ran the command voxl-vision-hub in the terminal with some of the outputted information shown below:
=================================================================
Parameters as loaded from config file:
config_file_version: 1MAVROS / MAVSDK
en_localhost_mavlink_udp 0
localhost_udp_port_number: 14551VIO
en_vio: 1
vio_pipe: qvio
secondary_vio_pipe: ov
en_reset_vio_if_initialized_inverted: 1
vio_warmup_s: 3.000000
send_odom_while_failed: 1MISC FEATURES
horizon_cal_tolerance: 0.500000
OFFBOARD MODE
offboard_mode: figure_eight
follow_tag_id: 0
figure_eight_move_home: 1
robot_radius: 0.300000
collision_sampling_dt: 0.100000
max_lookahead_distance: 1.000000
FIXED FRAME RELOCALIZATION
en_tag_fixed_frame: 0
fixed_frame_filter_len: 5
en_transform_mavlink_pos_setpoints_from_fixed_frame:0It should be noted that the drone has Ubuntu 18.04 and ROS2 foxy. The PX4 and Mavlink services are also enabled and running. I'm wondering if there is a step I'm missing or some software that I am missing. Anything helps. Thank you.
-
@GlennTee You will want to configure voxl-vision-hub to not send offboard commands if you are trying to use offboard commands from ROS2. Set
offboard_mode: off
in the configuration file/etc/modalai/voxl-vision-hub.conf
. -
@Eric-Katzfey Thank you, I will try that!
-
@Eric-Katzfey Hi again. I just tried flying it again and the drone did not default to running the Figure Eight program this time, but instead it did nothing once I swapped the controller to offboard mode. It did not arm, the props did not spin, or anything like that, but did absolutely nothing. I made sure to set "offboard_mode": "off" in voxl-vision-hub. I've attached a screenshot of my terminal below.
-
@GlennTee Okay, then probably some issue with connectivity between ROS2 and PX4. Doesn't seem like anything from ROS2 is getting to PX4. I'll ask some team members who have some experience with ROS2 what they think.
-
@GlennTee So that example requires you have the MicroDDS installed and running to communicate with PX4 (guide here).
Alternatively, you can run offboard commands via mavsdk (example here). If you do it this way, make sure to edit that example to connect on port 14551 and set en_localhost_mavlink_udp to true in 'etc/modalai/voxl-vision-hub.conf'.
Let me know if that helps.
-
@teddy-zaremba Thank you. I installed MicroDDS and am running the agent in VOXL2. I just enabled it and made sure the necessary services are running, but it looks like I got the same result as before, where nothing would happen after supposedly the Arm command was sent. Is there anything else I could be missing?
-
@GlennTee What do you see when you run ros2 topic list?
Have you run "apt-get install voxl-ros2-foxy && apt-get install voxl-mpa-to-ros2" followed by "voxl-configure-mpa-to-ros2".