Closed chibi314 closed 3 months ago
ごめん、質問の意図をちゃんと理解できていないので、 もう少し詳しく説明してくれるかな。
なるほど、確かにバグがあるね。
https://github.com/tongtybj/aerial_robot/blob/master/aerial_robot_base/src/flight_navigation.cpp#L578-L597 の部分は、launch初期にVIOやGPSの初期化が終わってない、もしくわそもそもないときに、高度センサのみになるので、if分の方では、強制的にacc_modeに切り替える(もともとのcontrol_modeは保存する-> prev_xy_control_mode)。VIOやGPSが使われるようになったら、elseの方に入って、もとのprev_xy_control_modeに戻すという機能を果たしている。どちらかというと、センサーフュージョンでx/yに関する状態推定ができないときに機能すべきで、今回みたいに意図的にacc_modeに切り替えた時に反応すべきではないハズ。
なので、一番シンプルな直し方は、
https://github.com/tongtybj/aerial_robot/blob/master/aerial_robot_base/src/flight_navigation.cpp#L228
の下に、
prev_xy_control_mode_ = flight_nav::ACC_CONTROL_MODE;
を挟めば解決するとはおもうけど、試してみてくれるかな
実装の意図を理解しました.試してみます.
@tongtybj
https://github.com/tongtybj/aerial_robot/blob/master/aerial_robot_base/src/flight_navigation.cpp#L594
この部分って
prev_xy_control_mode_
が変化しない気がするんですが挙動としては合っていますか?