How to control pitch, roll, yaw with mavros
Hello,
i am quiet new to the pixhawk, but quite familiar with ROS. I am searching for some informations how to control the pixhawk via mavros. I am using the px4 firmware. My plan is to use the altiude_hold_mode, so that the multicopter hovers at a specific height. Additionaly i want to control pitch, roll and yaw angles of the multicopter via ROS. A bit like a 2D control in 3D space but at a specific height.
I am a bit lost how to setup my pixhawk with the external computer (an odroid fixed to the multicopter).
I found this tutorial [ https://pixhawk.org/dev/ros/mavros_of... ] . So i can control the copter with help of standard ROS messages. More specific i can control: position, attitude, velocity and accelration. Here are my questions: In order to control the copter via mavros, it has to be in offboard_mode. Would this conflict with the altitude_hold_mode? And which message should i use to control roll/pitch/yaw? In my little project the copter has to fly with specific "angles".
Thx for your help.
EDIT1: The connection between the odroid and the pixhawk is working. I can handle the streams (baudrate, Hz) aswell. I am a bit confused about the whole mavros-setpoint part. I will try to order a bit ;).
If i use setpoint_position, how is the actual position of the copter calculated? I think it depends on my sensor setup right? For example distance sensor+GPS. Unfourtanetly i can't use a GPS or Optical Flow. Therefore this method will not work or?
The setpoint_attitude seems more like something that would fit, but it can't offer a stabil z position right? So i would have to read out the distance sensor and regulate the throttle by myself correct?
I wonder if it is easier to use the standard altitude_hold mode of the pixhawk. Additionally i would read out the imu data of the pixhawk and regulate pitch, roll, yaw over mavros/rc/override. Would this also be a possibility?