Class ScaledMimicController

Inheritance Relationships

Base Type

  • public robot_controllers_interface::Controller

Class Documentation

class ScaledMimicController : public robot_controllers_interface::Controller

Controller for a having one joint be a (scaled) mimic of another. Primary design use case is making a fake bellows joint that moves in relation to a torso lift joint.

Public Functions

inline ScaledMimicController()
inline virtual ~ScaledMimicController()
virtual int init(const std::string &name, rclcpp::Node::SharedPtr node, robot_controllers_interface::ControllerManagerPtr manager)

Initialize the controller and any required data structures.

Parameters:
  • nh – Node handle for this controller.

  • manager – The controller manager instance, this is needed for the controller to get information about joints, etc.

Returns:

0 if succesfully configured, negative values are error codes.

virtual bool start()

Attempt to start the controller. This should be called only by the ControllerManager instance.

Returns:

True if successfully started, false otherwise.

virtual bool stop(bool force)

Attempt to stop the controller. This should be called only by the ControllerManager instance.

Parameters:

force – Should we force the controller to stop? Some controllers may wish to continue running until they absolutely have to stop.

Returns:

True if successfully stopped, false otherwise.

virtual bool reset()

Cleanly reset the controller to it’s initial state. Some controllers may choose to stop themselves. This is mainly used in the case of the the robot exiting some fault condition.

Returns:

True if successfully reset, false otherwise.

virtual void update(const rclcpp::Time &now, const rclcpp::Duration &dt)

This is the update loop for the controller.

Parameters:
  • time – The system time.

  • dt – The timestep since last call to update.

inline virtual std::string getType()

Get the type of this controller.

virtual std::vector<std::string> getCommandedNames()

Get the names of joints/controllers which this controller commands.

virtual std::vector<std::string> getClaimedNames()

Get the names of joints/controllers which this controller exclusively claims.