jrl-umi3218 / mc_rtc

mc_rtc is an interface for simulated and real robotic systems suitable for real-time control
BSD 2-Clause "Simplified" License
122 stars 37 forks source link

[mc_control] call teardownIdleState after starting execution when fsm::Controller::reset was called #404

Closed orikuma closed 1 year ago

orikuma commented 1 year ago

Problem: The weight of the PostureTask is changed to 10000 by startIdleState when fsm::Controller::reset is called. However, if running_ is true when fsm::Controller::reset is called, the weight remains 10000 after starting execution of states because teardownIdleState will not be called in fsm::Controller::run while running_ remains true. This will cause inconsistency of the motion after changing controllers.

Solution: Set running_=false in fsm::Controller::reset to call teardownIdleState in fsm::Controller::run after starting a state.

orikuma commented 1 year ago

Thank you for your comment. I reflected your modification but it fails in the following tests.

The following tests FAILED:
         62 - TestFSMStateOptions (Failed)
         63 - TestFSMStateOptions_TVM (Failed)
         77 - SampleController_FSM (Failed)
         78 - SampleController_FSM_TVM (Failed)

I attached the log file of the test result. LastTest.log

gergondet commented 1 year ago

Hi @orikuma

Thanks for testing it out.

I have implemented a different fix in https://github.com/jrl-umi3218/mc_rtc/commit/2bfaf161bb7364dc8bd5aafc7bdabe29aea3027d that should work wherever in its execution an FSM is stoped.