Go to the documentation of this file.
32 #include "../NJointControllers/NJointKinematicUnitPassThroughController.h"
33 #include "../SensorValues/SensorValue1DoFActuator.h"
50 NJointKinematicUnitPassThroughControllerPtr
ctrlPos;
51 NJointKinematicUnitPassThroughControllerPtr
ctrlVel;
52 NJointKinematicUnitPassThroughControllerPtr
ctrlTor;
62 std::map<std::string, ActuatorData>&& newDevs,
63 std::vector<std::set<std::string>> controlDeviceHardwareControlModeGrps,
64 std::set<std::string> controlDeviceHardwareControlModeGrpsMerged,
69 void requestJoints(
const Ice::StringSeq&,
const Ice::Current&)
override;
70 void releaseJoints(
const Ice::StringSeq&,
const Ice::Current&)
override;
75 void switchControlMode(
const NameControlModeMap& ncm,
const Ice::Current&)
override;
83 Ice::StringSeq
getJoints(
const Ice::Current&
c)
const override;
85 DebugInfo
getDebugInfo(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
103 std::map<std::string, ActuatorData> devs;
106 mutable std::mutex dataMutex;
107 NameControlModeMap ctrlModes;
114 NameStatusMap statuses;
115 std::vector<std::set<std::string>> controlDeviceHardwareControlModeGroups;
116 std::set<std::string> controlDeviceHardwareControlModeGroupsMerged;
118 std::vector<VirtualRobot::RobotNodePtr> sensorLessJoints;
120 template <
class ValueT,
class SensorValueT, ValueT SensorValueT::*Member>
122 UpdateNameValueMap(std::map<std::string, ValueT>& nvm,
123 const std::string& name,
127 const SensorValueT*
s = sv->
asA<SensorValueT>();
132 const ValueT&
v =
s->*Member;
133 if (!nvm.count(name) || (nvm.at(name) !=
v))
void setupData(std::string relRobFile, VirtualRobot::RobotPtr rob, std::map< std::string, ActuatorData > &&newDevs, std::vector< std::set< std::string >> controlDeviceHardwareControlModeGrps, std::set< std::string > controlDeviceHardwareControlModeGrpsMerged, RobotUnit *newRobotUnit)
Ice::StringSeq getJoints(const Ice::Current &c) const override
void setJointVelocities(const NameValueMap &velocities, const Ice::Current &) override
void setJointAngles(const NameValueMap &angles, const Ice::Current &) override
NameValueMap getJointVelocities(const Ice::Current &) const override
Structure used by the RobotUnit to swap lists of Joint and NJoint controllers.
TYPEDEF_PTRS_HANDLE(NJointCartesianNaturalPositionController)
NJointControllerPtr getActiveController() const
The SensorValueBase class.
void setJointTorques(const NameValueMap &torques, const Ice::Current &) override
void update(const SensorAndControl &sc, const JointAndNJointControllers &c) override
void releaseJoints(const Ice::StringSeq &, const Ice::Current &) override
void requestJoints(const Ice::StringSeq &, const Ice::Current &) override
NJointControllerPtr getController(ControlMode c) const
std::size_t sensorDeviceIndex
NameValueMap getJointAngles(const Ice::Current &) const override
void onInitKinematicUnit() override
void setJointDecelerations(const NameValueMap &, const Ice::Current &) override
void onStartKinematicUnit() override
void setJointAccelerations(const NameValueMap &, const Ice::Current &) override
double v(double t, double v0, double a0, double j)
NameControlModeMap getControlModes(const Ice::Current &) override
SynchronousNJointControllerPtr NJointControllerPtr
The RobotUnit class manages a robot and its controllers.
DebugInfo getDebugInfo(const Ice::Current &c=Ice::emptyCurrent) const override
NJointKinematicUnitPassThroughControllerPtr ctrlPos
NJointKinematicUnitPassThroughControllerPtr ctrlTor
NJointKinematicUnitPassThroughControllerPtr ctrlVel
void switchControlMode(const NameControlModeMap &ncm, const Ice::Current &) override
double s(double t, double s0, double v0, double a0, double j)
This file offers overloads of toIce() and fromIce() functions for STL container types.
void onExitKinematicUnit() override
std::shared_ptr< class Robot > RobotPtr