Go to the documentation of this file.
46 const std::vector<std::string> & jointNames,
47 const std::string & robot_urdf,
62 const std::vector<std::string> & jointNames,
63 const std::vector<mc_rbdyn::Mimic> & mimics,
88 void reset(
const std::vector<double> & currentQ);
94 void reset(
const Gripper & gripper);
110 void setTargetQ(
const std::vector<double> & targetQ);
118 void setTargetQ(
const std::string & jointName,
double targetQ);
125 double getTargetQ(
const std::string & jointName)
const;
130 std::vector<double> getTargetQ()
const;
140 void setTargetOpening(
double targetOpening);
148 void setTargetOpening(
const std::string & jointName,
double targetOpening);
156 double getTargetOpening(
const std::string & jointName)
const;
161 std::vector<double> curPosition()
const;
166 std::vector<double> curOpening()
const;
174 double curOpening(
const std::string & jointName)
const;
177 inline const std::vector<std::string> &
joints()
const {
return names; }
180 inline const std::vector<std::string> &
activeJoints()
const {
return active_joints; }
185 return std::find(active_joints.begin(), active_joints.end(), jointName) != active_joints.end();
191 inline const std::vector<double> &
q()
const {
return _q; }
199 double opening()
const;
202 void percentVMAX(
double percent);
204 double percentVMAX()
const;
244 bool complete()
const;
250 inline bool is_metric() const noexcept {
return is_metric_; }
253 inline bool reversed() const noexcept {
return reversed_; }
260 void setTargetOpening(
size_t activeJointId,
double targetOpening);
267 void setTargetQ(
size_t activeJointId,
double targetQ);
270 void setTargetQ_(
size_t activeJoints,
double targetQ);
272 void setTargetQ_(
const std::vector<double> & targetQ);
275 double curPosition(
size_t jointId)
const;
278 double curOpening(
size_t jointId)
const;
281 double targetOpening(
size_t jointId)
const;
284 double getTargetQ(
size_t jointId)
const;
287 double clampQ(
size_t activeJoint,
double q);
310 std::vector<std::pair<size_t, double>>
mult;
314 std::vector<double>
_q;
343 bool reversed_ =
false;
Simplify access to values hold within a JSON file.
Definition: Configuration.h:165
std::unique_ptr< Gripper > GripperPtr
Definition: generic_gripper.h:346
std::vector< double > offset
Definition: generic_gripper.h:312
std::vector< size_t > active_joints_idx
Definition: generic_gripper.h:295
void actualCommandDiffTrigger(double d)
Definition: generic_gripper.h:213
bool is_metric_
Definition: generic_gripper.h:300
void overCommandLimitIterN(unsigned int N)
Definition: generic_gripper.h:219
const std::vector< std::string > & joints() const
Returns all joints involved in the gripper.
Definition: generic_gripper.h:177
std::vector< std::string > active_joints
Definition: generic_gripper.h:293
std::vector< unsigned int > overCommandLimitIter
Definition: generic_gripper.h:341
std::vector< double > percentOpen
Definition: generic_gripper.h:337
std::reference_wrapper< Gripper > GripperRef
Definition: generic_gripper.h:347
std::vector< int > joints_mbc_idx
Definition: generic_gripper.h:297
void releaseSafetyOffset(double offset)
Definition: generic_gripper.h:229
bool reversed() const noexcept
When true the gripper is considered "open" when the joints' values are minimal.
Definition: generic_gripper.h:253
std::vector< double > targetQIn
Definition: generic_gripper.h:317
const std::vector< std::string > & activeJoints() const
Returns all active joints involved in the gripper.
Definition: generic_gripper.h:180
bool hasActiveJoint(const std::string &jointName) const
Definition: generic_gripper.h:183
const std::vector< double > & q() const
Return all gripper joints configuration.
Definition: generic_gripper.h:191
std::vector< double > _q
Definition: generic_gripper.h:314
double actualCommandDiffTrigger() const
Definition: generic_gripper.h:215
std::vector< std::string > names
Definition: generic_gripper.h:291
bool is_metric() const noexcept
Returns true if a gripper is metric, i.e. all active joints are prismatic rather than revolute.
Definition: generic_gripper.h:250
#define MC_RBDYN_DLLAPI
Definition: api.h:50
Config savedConfig_
Definition: generic_gripper.h:332
Definition: RobotModule.h:115
std::vector< double > closeP
Definition: generic_gripper.h:303
unsigned int overCommandLimitIterN() const
Definition: generic_gripper.h:222
std::vector< double > openP
Definition: generic_gripper.h:305
std::vector< double > * targetQ
Definition: generic_gripper.h:319
Definition: CompletionCriteria.h:10
double releaseSafetyOffset() const
Definition: generic_gripper.h:232
A robot's gripper reprensentation.
Definition: generic_gripper.h:34
Definition: generic_gripper.h:14
Config config_
Definition: generic_gripper.h:330
Config defaultConfig_
Definition: generic_gripper.h:334
std::vector< double > vmax
Definition: generic_gripper.h:307
std::vector< double > reached_threshold_
Definition: generic_gripper.h:322
std::vector< bool > overCommandLimit
Definition: generic_gripper.h:339
std::vector< std::pair< size_t, double > > mult
Definition: generic_gripper.h:310
std::vector< double > actualQ
Definition: generic_gripper.h:325