Hello, I am trying to write code to control copter in GUIDED mode without GPS (I have a working solution controlling it in just GUIDED mode, but now I want to not rely on GPS (velocity data)).
Reading documentation I see that the only command accepted in GUIDED_NOGPS is SET_ATTITUDE_TARGET which should be ok for me.
But there is also note that type_mask
should always be 0b00000111. Meaning that yaw/pitch/roll rates are not supported. So I can only set absolute angles. Though looking in the source code (GCS_Mavlink.cpp) I see that when MAVLINK_MSG_ID_SET_ATTITUDE_TARGET
message is processed, body rates are actually accepted. Moreover I can use them to control the drone (tested in the sim). The problem arises when in addition to say yaw rate I also want to set attitude which inevitably also has yaw because it is set as a quaternion.
Am I right assuming that even though both rates and attitude quaternion is processed inside MAVLINK_MSG_ID_SET_ATTITUDE_TARGET
message handling I cannot use both of them because they will conflict with each other. E.g. setting yaw = 0 and yaw rate = 5 will lead to nothing?
I’ve also seen that e.g. DRIFT mode has input_euler_angle_roll_pitch_euler_rate_yaw
which presumably does what I want. But currently I do not see any way to achieve what I want without modifying ardupilot code. Is there an easier way?
edit: I could just modify yaw with curent_yaw += rate*dt but I am afraid it will not be that good because of latencies as I am doing it via Mavlink even though my companion computer is located on the copter itself.
Thank you!