How to send setpoint through Optitrack with Mavros

asked 2022-09-23 10:18:41 -0500

Tonzie gravatar image

updated 2022-09-25 11:56:51 -0500

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 topic_tools relay /mocap_node/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.

edit retag flag offensive close merge delete

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

ljaniec gravatar image ljaniec  ( 2022-09-23 10:28:16 -0500 )edit

These are the links i followed: http://wiki.ros.org/mavroshttps://github.com/mavlink/mavros/blo...http://wiki.ros.org/mocap_optitrack

Instead, I have not completely understand informations about this link: https://docs.px4.io/main/en/ros/mavro... 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...

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

Tonzie gravatar image Tonzie  ( 2022-09-23 10:55:01 -0500 )edit

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!

farhan_haroon_ gravatar image farhan_haroon_  ( 2023-07-23 11:55:43 -0500 )edit