10 #include <argos3/core/simulator/entity/embodied_entity.h>
21 cpShape* pt_gripper_shape) :
23 m_cGripperEntity(c_gripper_entity),
24 m_ptGripperShape(pt_gripper_shape),
27 m_ptGripperShape->sensor = 1;
29 m_ptGripperShape->data =
this;
47 for(
SInt32 i = 0; i < cpArbiterGetCount(pt_arb); ++i) {
48 m_tAnchor = cpvadd(m_tAnchor, cpArbiterGetPoint(pt_arb, i));
50 m_tAnchor = cpvmult(m_tAnchor, 1.0f / cpArbiterGetCount(pt_arb));
60 m_ptGripperShape->body,
63 m_tConstraint->maxBias = 0.95f;
64 m_tConstraint->maxForce = 10000.0f;
66 m_pcGrippee = pc_grippee;
67 m_pcGrippee->
Attach(*
this);
76 cpConstraintFree(m_tConstraint);
79 m_pcGrippee->
Remove(*
this);
89 m_cEmbodiedEntity(c_entity),
92 m_ptShape->data =
this;
106 m_listGrippers.push_back(&c_gripper);
113 CDynamics2DGripper::TList::iterator it =
114 std::find(m_listGrippers.begin(), m_listGrippers.end(), &c_gripper);
115 if(it != m_listGrippers.end()) {
116 m_listGrippers.erase(it);
124 CDynamics2DGripper::TList::iterator it =
125 std::find(m_listGrippers.begin(), m_listGrippers.end(), &c_gripper);
126 if(it != m_listGrippers.end()) {
135 while(!m_listGrippers.empty()) {
136 m_listGrippers.back()->Release();
147 CP_ARBITER_GET_SHAPES(pt_arb, ptGripperShape, ptGrippableShape);
163 CP_ARBITER_GET_SHAPES(pt_arb, ptGripperShape, ptGrippableShape);
175 cpSpaceAddPostStepCallback(
179 ptGrippableShape->data);
185 cpSpaceAddPostStepCallback(
206 pcGripper->
Grip(pcGrippable);