47 #ifndef _MIRA_DIFFERENTIALROBOTMODEL_H_ 48 #define _MIRA_DIFFERENTIALROBOTMODEL_H_ 54 namespace mira {
namespace robot {
80 template<
typename Reflector>
84 r.property(
"WheelDistance", wheelDist,
85 "Distance of the main drive wheels [m]. Must be greater than zero.");
98 virtual float predictStandstillDistance(
const Velocity2& v)
const;
100 virtual float predictStandstillRotation(
const Velocity2& v)
const;
115 SignedAnglef angleFromTotalDistance(
float totalLeft,
float totalRight)
const;
124 Velocity2 convert2Velocity(
float vLeft,
float vRight)
const;
131 std::pair<float, float> convert2LRWheelSpeed(
const Velocity2& v)
const;
137 float getMaxVelocity()
const;
160 float dphi = dt * v.r.angle();
164 float R = v.x() / v.r.angle();
166 dy = (1-cosf(dphi)) * R;
169 float s = dt * v.t.x();
170 dx = cosf(0.5f*dphi) * s;
171 dy = sinf(0.5f*dphi) * s;
173 return Pose2(dx,dy,dphi);
185 return 0.5f * (v.x()*v.x()) / a;
193 float rot = 0.5f * (v.phi()*v.phi()) / a;
194 return (v.phi() > 0 ? rot : -rot);
200 float totalRight)
const 204 float outlineLength = two_pi<float>() *
wheelDist;
217 float vTrans = v.x();
218 float vRot = v.r.angle();
220 return std::make_pair(vTrans-vRot, vTrans+vRot);
float maxEmergencyDeceleration
Max. deceleration in case of an emergency. Must be greater than zero.
Definition: UnicycleBasedRobotModel.h:148
float getMaxVelocity() const
Returns the absolute max.
Definition: DifferentialRobotModel.h:223
#define MIRA_REFLECT_BASE(reflector, BaseClass)
Definition: UnicycleBasedRobotModel.h:58
float maxBackwardVelocity
The maximum velocity for driving backward (both wheels) [m/s].
Definition: UnicycleBasedRobotModel.h:128
RigidTransform< float, 2 > Velocity2
float maxRotDeceleration
Max. deceleration. Must be greater than zero.
Definition: UnicycleBasedRobotModel.h:153
float maxForwardVelocity
The maximum velocity for driving forward (both wheels) [m/s].
Definition: UnicycleBasedRobotModel.h:131
Duration abs(const Duration &duration)
SignedAngle< float > SignedAnglef
boost::shared_ptr< DifferentialRobotModel > DifferentialRobotModelPtr
Typedef for DifferentialRobotModel pointer.
Definition: DifferentialRobotModel.h:148
void reflect(Reflector &r)
Definition: DifferentialRobotModel.h:81
virtual Pose2 localKinematics(const Velocity2 &v, float dt) const
Computes the local movement of the robot if it moves with the specified velocity v for the specified ...
Definition: DifferentialRobotModel.h:154
Velocity2 convert2Velocity(float vLeft, float vRight) const
Convert wheel speeds of left and right wheel to velocity (trans, rot)
Definition: DifferentialRobotModel.h:208
SignedAnglef angleFromTotalDistance(float totalLeft, float totalRight) const
Calculates the view direction of the robot from given traveled distance of left and right wheel and t...
Definition: DifferentialRobotModel.h:199
#define MIRA_OBJECT(classIdentifier)
virtual float predictStandstillDistance(const Velocity2 &v) const
Calculate the distance that is needed for braking to stand still, if the robot moves with the specifi...
Definition: DifferentialRobotModel.h:176
Probabilistic motion model for a robot with differential drive.
float wheelDist
The distance of both wheels. Must be greater than zero.
Definition: DifferentialRobotModel.h:144
Probabilistic motion model for a robot with differential drive.
Definition: DifferentialProbabilisticMotionModel.h:70
virtual float predictStandstillRotation(const Velocity2 &v) const
Calculate the rotation that is needed for braking to stand still, if the robot moves with the specifi...
Definition: DifferentialRobotModel.h:188
A robot model for robot with a differential drive (2 wheels on an axis, fixed orientation).
Definition: DifferentialRobotModel.h:68
std::pair< float, float > convert2LRWheelSpeed(const Velocity2 &v) const
Converts velocity into left and right wheel speeds.
Definition: DifferentialRobotModel.h:215
A robot model class for unicycle based motion models (differential drive, tricycle) ...
#define MIRA_ROBOT_DATATYPES_EXPORT
Definition: RobotDataTypesExports.h:61