Closed hildebrandt-carl closed 2 years ago
For example, pull request #18 should solve this. Let me know what you think.
Thanks, @hildebrandt-carl.
The ctrl_mode
variable is currently poorly defined. It is designed to mark which controllable elements are being worked on - in this case, the fields represent [x x x x r p y t]
(first four bits unused). This is a remnant from AscTec days, where it was possible to work entirely on individual "axes". See the message definition for what the intention currently is (although not implemented correctly). A good use for this field is to specify what some of outputs from the controller mean. For instance, since ArduPilot/PX4 supports sending yaw or yaw-rate, ctrl_mode
can specify how to interpret the yaw
field (yaw-rate is better indoors, while yaw may be sometimes preferable outdoors).
Note that any use of this field is disjoint from the autopilot/robot modes. The problem with your PR #18 is that it introduces a "loop", as well as a dependency on mavros
. A more suitable debug message, FreyjaStatus
, is already defined here, and should be used in the interface nodes in autopilot_handler
. Additionally, as noted in this message, it should not be used inside Freyja's nodes to trigger state machine transitions.
Thanks for the info. Not sure I fully understand its purpose, but if its a remnant from AscTec days I understand the want for keeping it. I will start using FreyjaStatus
or mavros/state
from now on when determine which mode I am in.
Hi,
I was looking through some of Freyjas code and noticed that the
rpyt_command
was hard coded to always have actrl_mode
of0b00001111
. More specifically inlqr_control_bias.cpp
line 253-259:I was wondering if this was intentional. If not would you like me to push submit a change where the control mode is updated based on the messages from
/mavros/state
topic?