Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Collapse
Brand Logo

ModalAI Forum

  1. ModalAI Support Forum
  2. Ask your questions right here!
  3. VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program

VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program

Scheduled Pinned Locked Moved Ask your questions right here!
25 Posts 6 Posters 6.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G GlennTee

    @teddy-zaremba Sorry for the late reply, I've already run both of those commands in that order. This is what comes up when I run "ros2 topic list"

    29fc1cc7-f198-49e7-b54d-1a376ed01046-image.png

    K Offline
    K Offline
    Kessie
    Contributor
    wrote on last edited by
    #10

    @GlennTee the problem lies in a mismatch between the topics which you see using "ros2 topic list" and the publishers from the offboard_control node.

    The ros2 node has publishers defined as follows:

    	OffboardControl() : Node("offboard_control")
    	{
    
    		offboard_control_mode_publisher_ = this->create_publisher<OffboardControlMode>("/fmu/in/offboard_control_mode", 10);
    		trajectory_setpoint_publisher_ = this->create_publisher<TrajectorySetpoint>("/fmu/in/trajectory_setpoint", 10);
    		vehicle_command_publisher_ = this->create_publisher<VehicleCommand>("/fmu/in/vehicle_command", 10);
    

    Do you know where you changed the prefix uav_4?
    I can't remember where to configure it.

    So, you can change the ROS2 code, rebuild and it should work. Or remove the uav_4 prefix

    G 1 Reply Last reply
    1
    • K Kessie

      @GlennTee the problem lies in a mismatch between the topics which you see using "ros2 topic list" and the publishers from the offboard_control node.

      The ros2 node has publishers defined as follows:

      	OffboardControl() : Node("offboard_control")
      	{
      
      		offboard_control_mode_publisher_ = this->create_publisher<OffboardControlMode>("/fmu/in/offboard_control_mode", 10);
      		trajectory_setpoint_publisher_ = this->create_publisher<TrajectorySetpoint>("/fmu/in/trajectory_setpoint", 10);
      		vehicle_command_publisher_ = this->create_publisher<VehicleCommand>("/fmu/in/vehicle_command", 10);
      

      Do you know where you changed the prefix uav_4?
      I can't remember where to configure it.

      So, you can change the ROS2 code, rebuild and it should work. Or remove the uav_4 prefix

      G Offline
      G Offline
      GlennTee
      Contributor
      wrote on last edited by
      #11

      @Kessie Thank you. I'm not sure where I changed the prefix, but I can try to find it.

      C 1 Reply Last reply
      0
      • G GlennTee

        @Kessie Thank you. I'm not sure where I changed the prefix, but I can try to find it.

        C Offline
        C Offline
        claw
        wrote on last edited by
        #12

        @Kessie The good news is that removing the prefix allows the px4 to see the messages and arm. Thank you! The bad news is that we weren't sure this would work so the drone wasn't in our flying lab and we had to physically grab it and disconnect the battery.

        We tried powering on the RC controller to push the kill switch, but even though it connected to the receiver, the drone didn't respond to any of the RC controls including the mode and motor disable switches.

        How do we operate in offboard mode while preserving the ability to take over manually? Would it have worked if we powered on the drone in manual or position hold and then switched to offboard? Do we launch our code before or after the mode change?

        K 1 Reply Last reply
        0
        • C claw

          @Kessie The good news is that removing the prefix allows the px4 to see the messages and arm. Thank you! The bad news is that we weren't sure this would work so the drone wasn't in our flying lab and we had to physically grab it and disconnect the battery.

          We tried powering on the RC controller to push the kill switch, but even though it connected to the receiver, the drone didn't respond to any of the RC controls including the mode and motor disable switches.

          How do we operate in offboard mode while preserving the ability to take over manually? Would it have worked if we powered on the drone in manual or position hold and then switched to offboard? Do we launch our code before or after the mode change?

          K Offline
          K Offline
          Kessie
          Contributor
          wrote on last edited by
          #13

          @claw You'll need to change the parameter COM_RC_OVERRIDE to also allow overriding offboard mode.

          Reference link : https://docs.px4.io/main/en/advanced_config/parameter_reference.html#COM_RC_OVERRIDE

          C G 2 Replies Last reply
          1
          • K Kessie

            @claw You'll need to change the parameter COM_RC_OVERRIDE to also allow overriding offboard mode.

            Reference link : https://docs.px4.io/main/en/advanced_config/parameter_reference.html#COM_RC_OVERRIDE

            C Offline
            C Offline
            claw
            wrote on last edited by
            #14

            @Kessie Great. Thank you for your help.

            1 Reply Last reply
            0
            • K Kessie

              @claw You'll need to change the parameter COM_RC_OVERRIDE to also allow overriding offboard mode.

              Reference link : https://docs.px4.io/main/en/advanced_config/parameter_reference.html#COM_RC_OVERRIDE

              G Offline
              G Offline
              GlennTee
              Contributor
              wrote on last edited by
              #15

              @Kessie Hi again, we just changed COM_RC_OVERRIDE to allow for overriding offboard mode and we were able to cut the motors while the drone was operating in offboard mode. We modified the PX4 ROS 2 Offboard Control Example code to only enable offboard mode and arm the drone, but we noticed that once the drone armed, it had a lot of throttle. I'm guessing there is a setting maybe in QGroundControl to modify the throttle somehow, or is there another way to fix this?

              G 1 Reply Last reply
              0
              • G GlennTee

                @Kessie Hi again, we just changed COM_RC_OVERRIDE to allow for overriding offboard mode and we were able to cut the motors while the drone was operating in offboard mode. We modified the PX4 ROS 2 Offboard Control Example code to only enable offboard mode and arm the drone, but we noticed that once the drone armed, it had a lot of throttle. I'm guessing there is a setting maybe in QGroundControl to modify the throttle somehow, or is there another way to fix this?

                G Offline
                G Offline
                GlennTee
                Contributor
                wrote on last edited by
                #16

                I just ran into another problem where I believe after running "voxl-configure-microdds" again, it seems some of my changes were reset as I noticed "offboard_mode" defaulted back to "figure_eight" while looking in the vision-hub config file. However, I did notice that my changes with the node publishers were not changed.
                9ede8047-26a7-4a41-8c04-bb7fcd35c104-image.png
                I thought I have reverted everything to how it was before, but the drone is now back to not flying at all. I also noticed that my list of ros2 topics has also shrunk down as well.
                bb2d4d6b-c60e-4e5a-bee8-66793f50ddc4-image.png

                T G 2 Replies Last reply
                0
                • G GlennTee

                  I just ran into another problem where I believe after running "voxl-configure-microdds" again, it seems some of my changes were reset as I noticed "offboard_mode" defaulted back to "figure_eight" while looking in the vision-hub config file. However, I did notice that my changes with the node publishers were not changed.
                  9ede8047-26a7-4a41-8c04-bb7fcd35c104-image.png
                  I thought I have reverted everything to how it was before, but the drone is now back to not flying at all. I also noticed that my list of ros2 topics has also shrunk down as well.
                  bb2d4d6b-c60e-4e5a-bee8-66793f50ddc4-image.png

                  T Offline
                  T Offline
                  teddy.zaremba
                  Contributor
                  wrote on last edited by
                  #17

                  @GlennTee said in VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program:

                  I thought I have reverted everything to how it was before, but the drone is now back to not flying at all. I also noticed that my list of ros2 topics has also shrunk down as well.

                  This likely means that those topics got populated from the offboard script not the px4-ros bridge. Could you check that voxl-microdds-agent is running when you see this happen.

                  Check with "voxl-inspect-services"

                  2f02cb49-ce93-4bb0-ad98-4163a961fa02-image.png

                  1 Reply Last reply
                  1
                  • G GlennTee

                    I just ran into another problem where I believe after running "voxl-configure-microdds" again, it seems some of my changes were reset as I noticed "offboard_mode" defaulted back to "figure_eight" while looking in the vision-hub config file. However, I did notice that my changes with the node publishers were not changed.
                    9ede8047-26a7-4a41-8c04-bb7fcd35c104-image.png
                    I thought I have reverted everything to how it was before, but the drone is now back to not flying at all. I also noticed that my list of ros2 topics has also shrunk down as well.
                    bb2d4d6b-c60e-4e5a-bee8-66793f50ddc4-image.png

                    G Offline
                    G Offline
                    GlennTee
                    Contributor
                    wrote on last edited by GlennTee
                    #18

                    @teddy-zaremba Hi, I just checked using that command and it appears the agent is enabled, but it is not running.
                    8a5d37ad-cb10-44da-9849-16d26502a287-image.png

                    T 1 Reply Last reply
                    0
                    • G GlennTee

                      @teddy-zaremba Hi, I just checked using that command and it appears the agent is enabled, but it is not running.
                      8a5d37ad-cb10-44da-9849-16d26502a287-image.png

                      T Offline
                      T Offline
                      teddy.zaremba
                      Contributor
                      wrote on last edited by
                      #19

                      @GlennTee Can you run the command "voxl-microdds-agent" and share your output please?

                      G 1 Reply Last reply
                      0
                      • T teddy.zaremba

                        @GlennTee Can you run the command "voxl-microdds-agent" and share your output please?

                        G Offline
                        G Offline
                        GlennTee
                        Contributor
                        wrote on last edited by
                        #20

                        @teddy-zaremba said in VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program:

                        voxl-microdds-agent"

                        This is what I get:
                        0ca1964f-a566-4197-b459-8f83fc26b790-image.png

                        T 1 Reply Last reply
                        0
                        • G GlennTee

                          @teddy-zaremba said in VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program:

                          voxl-microdds-agent"

                          This is what I get:
                          0ca1964f-a566-4197-b459-8f83fc26b790-image.png

                          T Offline
                          T Offline
                          teddy.zaremba
                          Contributor
                          wrote on last edited by
                          #21

                          @GlennTee This looks fine to me if it's not running I'd suggest just restarting the service via "systemctl restart voxl-microdds-agent" and then double check that it's running with "voxl-inspect-services"

                          C 1 Reply Last reply
                          0
                          • T teddy.zaremba

                            @GlennTee This looks fine to me if it's not running I'd suggest just restarting the service via "systemctl restart voxl-microdds-agent" and then double check that it's running with "voxl-inspect-services"

                            C Offline
                            C Offline
                            claw
                            wrote on last edited by
                            #22

                            @teddy-zaremba Your help is very much appreciated.

                            Ok, so some of the confusion was related to editing the Python example, but it's actually running the cpp code. With that corrected, it shows all of the expected topics in the "ros2 topic list" and the code sends the arm command to the correct topic according to "ros2 topic echo /uav_4/fmu/in/vehicle_command", however, the Starling doesn't arm. We're trusting the example code as to the data structure that is actually populated and sent to that topic. Is there a reference as to what that should be?

                            1 Reply Last reply
                            0
                            • Zachary Lowell 0Z Offline
                              Zachary Lowell 0Z Offline
                              Zachary Lowell 0
                              ModalAI Team
                              wrote on last edited by
                              #23

                              @claw said in VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program:

                              Ok, so some of the confusion was related to editing the Python example, but it's actually running the cpp code. With that corrected, it shows all of the expected topics in the "ros2 topic list" and the code sends the arm command to the correct topic according to "ros2 topic echo /uav_4/fmu/in/vehicle_command", however, the Starling doesn't arm. We're trusting the example code as to the data structure that is actually populated and sent to that topic. Is there a reference as to what that should be?

                              Reply

                              @claw what code are you referring to? The ros2 figure 8 code is written in python:

                              Link Preview Image
                              colcon_ws/src/voxl_offboard_figure8/voxl_offboard_figure8/voxl_offboard_figure8.py · master · voxl / VOXL SDK / Utilities / voxl-mpa-to-ros2 · GitLab

                              GitLab.com

                              favicon

                              GitLab (gitlab.com)

                              voxl-mpa-to-ros2 itself is written in CPP, but this node specific is in python as it can be either. With the DDS running, you do not need the voxl-mpa-to-ros2 code running as that just converts MPA to ros2, but regardless you dont need that running if the goal is just to publish to the dds via this ros2 node. How are you executing this? ros2 run voxl_offboard_figure8 voxl_offboard_figure8?

                              G 1 Reply Last reply
                              0
                              • Zachary Lowell 0Z Zachary Lowell 0

                                @claw said in VOXL2/ROS2 Drone Runs Figure 8 Offboard Program Instead of My Program:

                                Ok, so some of the confusion was related to editing the Python example, but it's actually running the cpp code. With that corrected, it shows all of the expected topics in the "ros2 topic list" and the code sends the arm command to the correct topic according to "ros2 topic echo /uav_4/fmu/in/vehicle_command", however, the Starling doesn't arm. We're trusting the example code as to the data structure that is actually populated and sent to that topic. Is there a reference as to what that should be?

                                Reply

                                @claw what code are you referring to? The ros2 figure 8 code is written in python:

                                Link Preview Image
                                colcon_ws/src/voxl_offboard_figure8/voxl_offboard_figure8/voxl_offboard_figure8.py · master · voxl / VOXL SDK / Utilities / voxl-mpa-to-ros2 · GitLab

                                GitLab.com

                                favicon

                                GitLab (gitlab.com)

                                voxl-mpa-to-ros2 itself is written in CPP, but this node specific is in python as it can be either. With the DDS running, you do not need the voxl-mpa-to-ros2 code running as that just converts MPA to ros2, but regardless you dont need that running if the goal is just to publish to the dds via this ros2 node. How are you executing this? ros2 run voxl_offboard_figure8 voxl_offboard_figure8?

                                G Offline
                                G Offline
                                GlennTee
                                Contributor
                                wrote on last edited by
                                #24

                                @Zachary-Lowell-0 Hi, the code we are referring to is from an example on the PX4 website, where the drone should engage in offboard mode, arm, ascend a desired height, and wait. The link to that is here: https://docs.px4.io/main/en/ros2/offboard_control.html

                                We are trying to run this program on our Starling drone, and the line we are running to execute the program is "ros2 run px4_ros_com offboard_control"

                                With the changes made, we now see that the arm command is being sent to the correct topic, but the drone continues to not arm.

                                G 1 Reply Last reply
                                0
                                • G GlennTee

                                  @Zachary-Lowell-0 Hi, the code we are referring to is from an example on the PX4 website, where the drone should engage in offboard mode, arm, ascend a desired height, and wait. The link to that is here: https://docs.px4.io/main/en/ros2/offboard_control.html

                                  We are trying to run this program on our Starling drone, and the line we are running to execute the program is "ros2 run px4_ros_com offboard_control"

                                  With the changes made, we now see that the arm command is being sent to the correct topic, but the drone continues to not arm.

                                  G Offline
                                  G Offline
                                  GlennTee
                                  Contributor
                                  wrote on last edited by
                                  #25

                                  @GlennTee Good news! The program now runs, turns out I needed to add the .py extension to the file name when calling the run command, so it should be "ros2 run px4_ros_com offboard_control.py"

                                  However, we experienced a lot of errors while running. The drone did arm (But only would do every even numbered attempt for some reason), however it did not fly. I'm working now to debug these errors.
                                  image(1).png

                                  1 Reply Last reply
                                  0

                                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                  With your input, this post could be even better 💗

                                  Register Login
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  ModalAI
                                  Categories Recent Tags ModalAI.com Docs
                                  © 2026 ModalAI® · Accelerating autonomy for smaller, smarter, safer drones · Powered by NodeBB
                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users
                                  • Groups