Skip to content

How to quick stop a slave? #173

@qleonardolp

Description

@qleonardolp

Hello. I'm trying to implement the quick stop feature in a custom ros2_control controller. By now, we are able to manage the driver mode_of_operation through the respective interface, claimed by the controller, and command the slave when the controller is active, either through position or velocity.

We are considering set the quick stop bit in the controlword when deactiving the controller (ros2 control set_controller_state <controller_name> inactive). The controller does write on the controlword, since the interface is available and claimed, but the slave state machine will be at PRE-OP after that.

To do so, we write the desired controlword for the joints as:

  for (size_t joint = 0; joint < dof_; ++joint) {
    joint_command_interface_[4][joint].get().set_value(0b000000010);  // Quick-stop bit 1
  }

The first index, 4, is because the other indexes are reserved for other command interfaces.

When implementing the on_activate method, the controller fails to make the state machine transitions Faultless -> Ready -> Waiting to enable -> Running. For such transitions I'm writing 0b00000000, 0b00000110, 0b00000111, and 0b00001111, respectively in the controlword. What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions