Robotics StackExchange | Archived questions

How to send setpoint through Optitrack with Mavros

Hello everyone, i would like to know how can i send setpoint to my MAV, after connecting with MAVROS.

I want to track position through Optitrack and the Motive software and then send it as a setpoint for my drone.

This is my setup: Ardupilot on my Pixracer R15, ROS Noetic on an Ubuntu operating system, with Mavros and Mocap_optitrack packages installed.

These following commands are working:

1 roslaunch mavros apm.launch fcu_url:=udp://:14550@192.168.4.1:14555

2 (after configuring a new rigid body in Motive and mocap.yaml) roslaunch mocap_optitrack mocap.launch

3 rosrun topictools relay /mocapnode/rigidbody/pose /mavros/local_position/pose

Now that i have the pose published from Optitrack to my MAV, what I am supposed to do to move it in a certain position? Do I need to write a ROS node like in the Offboard Example or there is a better/simple way to do it?

Thanks in advance, I Would really appreciate an answer because I am fighting with it a lot.

Asked by Tonzie on 2022-09-23 10:18:41 UTC

Comments

Please add links to packages and software you are using so we can look into them - probably there are some simple planners already implemented, we need to see how to call them with your arguments

Asked by ljaniec on 2022-09-23 10:28:16 UTC

These are the links i followed: http://wiki.ros.org/mavros https://github.com/mavlink/mavros/blob/master/mavros/README.md#installation http://wiki.ros.org/mocap_optitrack

Instead, I have not completely understand informations about this link: https://docs.px4.io/main/en/ros/mavros_offboard_python.html This is the part that theoretically should help me to understand how to fly drone, setting it in Offboard Mode.

Otherwise I don't know how to move forward.

I tried to install a simulation tool with gazebo following this: https://docs.px4.io/main/en/dev_setup/building_px4.html

but I am receiving errors when i launch --> ~/PX4-Autopilot$ make px4_sitl gazebo_plane

Asked by Tonzie on 2022-09-23 10:55:01 UTC

Hello!

Were you able to figure out a way to send setpoints to the QuadCopter to go to the specified positions? I really need help!

Asked by farhan_haroon_ on 2023-07-23 11:55:43 UTC

Answers