Skip to content
Snippets Groups Projects
Commit c05391ed authored by Markus Swarowsky's avatar Markus Swarowsky
Browse files

target get set to 0 at activation of pass through controller

also added PlatformTarget
parent c6df7483
No related branches found
No related tags found
No related merge requests found
......@@ -34,6 +34,7 @@
#include <RobotAPI/libraries/RobotRTControllers/Targets/JointTorqueTarget.h>
#include <RobotAPI/libraries/RobotRTControllers/Targets/JointVelocityTarget.h>
#include <RobotAPI/libraries/RobotRTControllers/DataUnits/KinematicDataUnit.h>
#include <RobotAPI/libraries/RobotRTControllers/Targets/PlatformWheelVelocityTarget.h>
namespace armarx
{
......@@ -134,9 +135,38 @@ namespace armarx
}
};
template <>
struct PassThroughControllerTargetTypeTraits<PlatformWheelVelocityTarget>
{
static float* getTargetDatamember(PlatformWheelVelocityTarget& t)
{
return &t.velocity;
}
static const float* getFrontRightWheelVelocity(const PlatformDataUnitInterface* pu)
{
return pu->getFrontRightWheelVelocity();
}
static const float* getFrontLeftWheelVelocity(const PlatformDataUnitInterface* pu)
{
return pu->getFrontLeftWheelVelocity();
}
static const float* getRearRightWheelVelocity(const PlatformDataUnitInterface* pu)
{
return pu->getRearRightWheelVelocity();
}
static const float* getRearLeftWheelVelocity(const PlatformDataUnitInterface* pu)
{
return pu->getRearLeftWheelVelocity();
}
static std::string getControlMode()
{
return ControlModes::VelocityMode;
}
};
LVL1ControllerRegistration<PassThroughController<JointPositionTarget>> registrationSomeControllerPositionPassThroughController("PositionPassThroughController");
LVL1ControllerRegistration<PassThroughController<JointVelocityTarget>> registrationSomeControllerVelocityPassThroughController("VelocityPassThroughController");
LVL1ControllerRegistration<PassThroughController<JointTorqueTarget >> registrationSomeControllerJointPassThroughController("JointPassThroughController");
LVL1ControllerRegistration<PassThroughController<JointTorqueTarget >> registrationSomeControllerJointPassThroughController("TorquePassThroughController");
template <typename TargetType>
std::string PassThroughController<TargetType>::getClassName(const Ice::Current&) const
......@@ -194,6 +224,8 @@ namespace armarx
for (std::size_t i = 0; i < jointStates.size(); ++i)
{
iceTargets.at(i).val.store(*jointStates.at(i));
//set it to zero
iceTargets.at(i).val.store(0.0);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment