mc_control::fsm::Grippers Struct Reference

#include <mc_control/fsm/states/Grippers.h>

Inheritance diagram for mc_control::fsm::Grippers:
Collaboration diagram for mc_control::fsm::Grippers:

Public Member Functions

void start (Controller &) override
 
bool run (Controller &) override
 
void teardown (Controller &) override
 
- Public Member Functions inherited from mc_control::fsm::State
virtual ~State ()
 
void configure_ (const mc_rtc::Configuration &config)
 
void start_ (Controller &ctl)
 
void teardown_ (Controller &ctl)
 
virtual void stop (Controller &)
 
virtual bool read_msg (std::string &)
 
virtual bool read_write_msg (std::string &, std::string &)
 
const std::string & output () const noexcept
 
const std::string & name ()
 
void name (const std::string &n)
 

Protected Attributes

std::vector< mc_control::GripperRefgrippers_
 
bool keepSafetyConfig_ = false
 
- Protected Attributes inherited from mc_control::fsm::State
mc_rtc::Configuration add_contacts_config_
 
mc_rtc::Configuration remove_contacts_config_
 
mc_rtc::Configuration add_contacts_after_config_
 
mc_rtc::Configuration remove_contacts_after_config_
 
mc_rtc::Configuration add_collisions_config_
 
mc_rtc::Configuration remove_collisions_config_
 
mc_rtc::Configuration add_collisions_after_config_
 
mc_rtc::Configuration remove_collisions_after_config_
 
mc_rtc::Configuration constraints_config_
 
mc_rtc::Configuration tasks_config_
 
mc_rtc::Configuration remove_posture_task_
 
mc_rtc::Configuration config_
 
std::vector< mc_solver::ConstraintSetPtrconstraints_
 
std::vector< std::pair< mc_tasks::MetaTaskPtr, mc_rtc::Configuration > > tasks_
 
std::vector< mc_tasks::PostureTaskPtrpostures_
 

Additional Inherited Members

- Protected Member Functions inherited from mc_control::fsm::State
void output (const std::string &o)
 
virtual void configure (const mc_rtc::Configuration &config)
 

Detailed Description

Controls the gripper of a robot

This states brings the specified grippers to a specific configuration and outputs "OK" once the grippers' targets are realized.

Configuration options:

  • robot: for which robot's grippers this state applies, if ommited, it is assumed to be the main robot in the controller
  • grippers: each entry in this object is considered as a gripper, for each object, one can specify the gripper target as:
    • target: an array of double corresponding to the joint configuration of the gripper
    • opening: a single double value between 0 (closed) and 1 (open)

Example:

The following configuration sets a joint target for "l_gripper" (0.7 for the first joint in the gripper and 0.5 for the second joint in the gripper) and a target opening percentage of 0.5 for "r_gripper".

{
"robot": "jvrc1",
"grippers":
{
"l_gripper": { "target": [0.7, 0.5] },
"r_gripper": { "opening": 0.5 }
}
}

Member Function Documentation

◆ run()

bool mc_control::fsm::Grippers::run ( Controller ctl)
overridevirtual

Called every iteration until it returns true

Implements mc_control::fsm::State.

◆ start()

void mc_control::fsm::Grippers::start ( Controller ctl)
overridevirtual

Called before the state starts being run

This will be called only once with the state fully configured.

Implements mc_control::fsm::State.

◆ teardown()

void mc_control::fsm::Grippers::teardown ( Controller ctl)
overridevirtual

Called right before destruction

Implements mc_control::fsm::State.

Member Data Documentation

◆ grippers_

std::vector<mc_control::GripperRef> mc_control::fsm::Grippers::grippers_
protected

◆ keepSafetyConfig_

bool mc_control::fsm::Grippers::keepSafetyConfig_ = false
protected

The documentation for this struct was generated from the following file: