Dear reader,
I am making a plugin that simulates a vacuum gripper. For this I need to connect two entities. I was advised by Microsoft’s copilot to use the following method:
// Create a joint to attach the object to the gripper
dataPtr->jointEntity = _ecm.CreateEntity();
// Add a FixedJoint component to the new entity
_ecm.CreateComponent(dataPtr->jointEntity, gz::sim::components::Joint());
// Set the parent and child links for the joint
// Set the parent and child links for the joint
_ecm.CreateComponent(dataPtr->jointEntity, gz::sim::components::ParentEntity(gripper_entity.value()));
_ecm.CreateComponent(dataPtr->jointEntity, gz::sim::components::ChildEntity(object_entity));
Unfortunately the ChildEntity does not exist in Components and I get the following compile error:
error: ‘ChildEntity’ is not a member of ‘gz::sim::v8::components’
_ecm.CreateComponent(dataPtr->jointEntity, gz::sim::components::ChildEntity(object_entity));
I also don’t know if I’m using the right method for this. Who can help me with this?
Thanks in advance, greetings Gerard