I am doing a test using the code of the offboard example with an optitrack camera system (6 Flex 13), I am not using a companion computer, I am using a ubuntu pc with kinetic ros and 1.6.3 firmware version, my procedure is:
One Windows computer running Motive 1.10, streaming data using the vrpn broadcast.
One Ubuntu computer connected via LAN to the first, running ROS (including MAVROS and vrpn_client_ros).
vrpn_client_node with the Motive IP as an argument. This node will auto-detect trackers and send positions to / tf.
$ roslaunch vrpn_client_ros sample.launch server: = 192.168.1.192
I connect with a usb my ubuntu pc to fcu (pixhawk).
$ rosrun mavros mavros_node fcuurl: = / dev / ttyACM0: 921600
To have the pose data sent to mavros, I use a relay node from the topic_tools:
$ rosrun topic_tools relay /vrpn_client_node/Quadcopter /pose/ mavros/mocap/pose
Finally, I send the setpoints to mavros/setpoint_position/local
$ rosrun quadrirotor offboard_example
Offboard_example.cpp is a file similar to https://dev.px4.io/en/ros/mavros_offboard.html, just add the orientation.
I want my 3dr iris to get an altitude of 0.5 m (z = 0.5m) and stay at that point.
My problem is that I do not get the desired result, my drone takes off and flies to any direction, the drone does not get a desired altitude.
Why does this happen?
Is it necessary to have a companion computer?
I attach some images: rqt_grapg, my ubuntu terminal and offbiard_example.cpp
my offboard_example video: https://youtu.be/XBbBbEaNlrc