ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

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

    Ask your questions right here!
    6
    25
    733
    Loading More Posts
    • 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.
    • T
      teddy.zaremba @GlennTee
      last edited by

      @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 Reply Quote 0
      • C
        claw @teddy.zaremba
        last edited by

        @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 Reply Quote 0
        • Zachary Lowell 0Z
          Zachary Lowell 0 ModalAI Team
          last edited by

          @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:

          https://gitlab.com/voxl-public/voxl-sdk/utilities/voxl-mpa-to-ros2/-/blob/master/colcon_ws/src/voxl_offboard_figure8/voxl_offboard_figure8/voxl_offboard_figure8.py?ref_type=heads

          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 Reply Quote 0
          • G
            GlennTee @Zachary Lowell 0
            last edited by

            @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 Reply Quote 0
            • G
              GlennTee @GlennTee
              last edited by

              @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 Reply Quote 0
              • First post
                Last post
              Powered by NodeBB | Contributors