Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joint Force-Torque Systems Plugin #977

Merged
merged 13 commits into from
Sep 22, 2021
Prev Previous commit
Next Next commit
updated code
  • Loading branch information
chawladevansh authored and azeey committed Sep 22, 2021
commit 4c4baebe174c2312b6212fcc942b6c3945f5bc7d
12 changes: 3 additions & 9 deletions src/systems/force_torque/ForceTorque.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

#include "ignition/gazebo/components/ForceTorque.hh"
#include "ignition/gazebo/components/JointForce.hh"
#include "ignition/gazebo/components/JointTorque.hh"
#include "ignition/gazebo/components/Joint.hh"
#include "ignition/gazebo/components/Name.hh"
#include "ignition/gazebo/components/Pose.hh"
#include "ignition/gazebo/components/ParentEntity.hh"
mjcarroll marked this conversation as resolved.
Show resolved Hide resolved
Expand Down Expand Up @@ -134,10 +134,9 @@ void ForceTorquePrivate::CreateForceTorqueEntities(EntityComponentManager &_ecm)
}

// Create FT Sensors
_ecm.EachNew<components::ForceTorque, components::ParentEntity>(
_ecm.EachNew<components::ForceTorque>(
[&](const Entity &_entity,
const components::ForceTorque *_ft,
const components::ParentEntity *_parent)->bool
const components::ForceTorque *_ft)->bool
{
// create sensor
std::string sensorScopedName =
Expand All @@ -160,11 +159,6 @@ void ForceTorquePrivate::CreateForceTorqueEntities(EntityComponentManager &_ecm)
return true;
}

// set sensor parent
std::string parentName = _ecm.Component<components::Name>(
_parent->Data())->Data();
sensor->SetParent(parentName);

// Set topic
_ecm.CreateComponent(_entity, components::SensorTopic(sensor->Topic()));

Expand Down