Skip to content

Conversation

Jonas-Witt
Copy link

This adds a new axis state AXIS_STATE_BRAKE that is the same as closed loop control with forced velocity control & zero velocity input. The main purpose of this new state is to allow a defined axis state that we can safely fallback to in case of a watchdog timeout. A new axis configuration enable_brake_state_fallthrough_on_watchdog_timeout controls this behavior. This fallthrough is a useful safety feature for wheeled robots that may encounter a state where the controlling node disappears and a watchdog timeout is triggered to keep the wheeled robot from rolling down an incline uncontrolled in idle mode.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Jonas Witt seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@Wetmelon
Copy link
Collaborator

Hi Jonas, thanks for the PR. Do you have test data you can share?

Comment on lines +183 to +185
//controller_.config_.control_mode = Controller::CONTROL_MODE_VELOCITY_CONTROL;
//controller_.config_.input_mode = Controller::INPUT_MODE_PASSTHROUGH;
//controller_.input_vel_ = 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code

@Wetmelon
Copy link
Collaborator

Is there anything in this PR to prevent spurious communications from fighting with the watchdog for control of the axis?


while ((requested_state_ == AXIS_STATE_UNDEFINED) && motor_.is_armed_) {
controller_.config_.control_mode = Controller::CONTROL_MODE_VELOCITY_CONTROL;
controller_.input_vel_ = 0.0f;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the axis isn't in in INPUT_MODE_PASSTHROUGH?

@madcowswe
Copy link
Member

madcowswe commented Jan 14, 2022

I would say it's better to avoid a new state that is the same as closed loop control just with some overrides in the inputs. I would suggest to instead just override the inputs directly right before the "update inputs" section of controller.cpp
image

@Wetmelon
Copy link
Collaborator

This PR should be refactored and made to fix #704

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants