72 quantity<angular_velocity> RadPerSec_FromX;
73 quantity<angular_velocity> RadPerSec_FromY;
74 quantity<angular_velocity> RadPerSec_FromTheta;
75 wheelVelocities.assign(4, RadPerSec_FromX);
78 throw std::out_of_range(
"The wheelRadius, RotationRatio or the SlideRatio are not allowed to be zero");
82 RadPerSec_FromX = longitudinalVelocity.value() /
config.
wheelRadius.value() * radian_per_second;
88 wheelVelocities[0] = -RadPerSec_FromX + RadPerSec_FromY + RadPerSec_FromTheta;
89 wheelVelocities[1] = RadPerSec_FromX + RadPerSec_FromY + RadPerSec_FromTheta;
90 wheelVelocities[2] = -RadPerSec_FromX - RadPerSec_FromY + RadPerSec_FromTheta;
91 wheelVelocities[3] = RadPerSec_FromX - RadPerSec_FromY + RadPerSec_FromTheta;
106 if (wheelVelocities.size() < 4)
107 throw std::out_of_range(
"To less wheel velocities");
110 throw std::out_of_range(
"The lengthBetweenFrontAndRearWheels or the lengthBetweenFrontWheels are not allowed to be zero");
117 longitudinalVelocity = (-wheelVelocities[0] + wheelVelocities[1] - wheelVelocities[2] + wheelVelocities[3]).value() * wheel_radius_per4.value() * meter_per_second;
118 transversalVelocity = (wheelVelocities[0] + wheelVelocities[1] - wheelVelocities[2] - wheelVelocities[3]).value() * wheel_radius_per4.value() * meter_per_second;
119 angularVelocity = (wheelVelocities[0] + wheelVelocities[1] + wheelVelocities[2] + wheelVelocities[3]) * (wheel_radius_per4 / geom_factor).value();
133 if (wheelPositions.size() < 4)
134 throw std::out_of_range(
"To less wheel positions");
137 throw std::out_of_range(
"The lengthBetweenFrontAndRearWheels or the lengthBetweenFrontWheels are not allowed to be zero");
148 quantity<si::length> deltaLongitudinalPos;
149 quantity<si::length> deltaTransversalPos;
164 deltaLongitudinalPos = (-deltaPositionW1 + deltaPositionW2 - deltaPositionW3 + deltaPositionW4).value() * wheel_radius_per4.value() * meter;
165 deltaTransversalPos = (deltaPositionW1 + deltaPositionW2 - deltaPositionW3 - deltaPositionW4).value() * wheel_radius_per4.value() * meter;
166 angle += (deltaPositionW1 + deltaPositionW2 + deltaPositionW3 + deltaPositionW4) * (wheel_radius_per4 / geom_factor).value();
187 quantity<plane_angle> Rad_FromX;
188 quantity<plane_angle> Rad_FromY;
189 quantity<plane_angle> Rad_FromTheta;
190 wheelPositions.assign(4, Rad_FromX);
193 throw std::out_of_range(
"The wheelRadius, RotationRatio or the SlideRatio are not allowed to be zero");
203 wheelPositions[0] = -Rad_FromX + Rad_FromY + Rad_FromTheta;
204 wheelPositions[1] = Rad_FromX + Rad_FromY + Rad_FromTheta;
205 wheelPositions[2] = -Rad_FromX - Rad_FromY + Rad_FromTheta;
206 wheelPositions[3] = Rad_FromX - Rad_FromY + Rad_FromTheta;
215 this->
config = configuration;
221 configuration = this->
config;
virtual void wheelVelocitiesToCartesianVelocity(const std::vector< quantity< angular_velocity > > &wheelVelocities, quantity< si::velocity > &longitudinalVelocity, quantity< si::velocity > &transversalVelocity, quantity< angular_velocity > &angularVelocity)
virtual ~FourSwedishWheelOmniBaseKinematic()
quantity< si::length > wheelRadius
quantity< si::length > longitudinalPos
void setConfiguration(const FourSwedishWheelOmniBaseKinematicConfiguration &configuration)
void getConfiguration(FourSwedishWheelOmniBaseKinematicConfiguration &configuration) const
std::vector< quantity< plane_angle > > lastWheelPositions
quantity< si::length > transversalPos
virtual void cartesianPositionToWheelPositions(const quantity< si::length > &longitudinalPosition, const quantity< si::length > &transversalPosition, const quantity< plane_angle > &orientation, std::vector< quantity< plane_angle > > &wheelPositions)
FourSwedishWheelOmniBaseKinematic()
quantity< si::length > lengthBetweenFrontAndRearWheels
quantity< plane_angle > angle
FourSwedishWheelOmniBaseKinematicConfiguration config
Configuration for the base kinematic with four swedish wheels.
virtual void cartesianVelocityToWheelVelocities(const quantity< si::velocity > &longitudinalVelocity, const quantity< si::velocity > &transversalVelocity, const quantity< si::angular_velocity > &angularVelocity, std::vector< quantity< angular_velocity > > &wheelVelocities)
bool lastWheelPositionInitialized
quantity< si::length > lengthBetweenFrontWheels
virtual void wheelPositionsToCartesianPosition(const std::vector< quantity< plane_angle > > &wheelPositions, quantity< si::length > &longitudinalPosition, quantity< si::length > &transversalPosition, quantity< plane_angle > &orientation)