23#include "forward_drive_mode.h"
25#include <utils/math/common.h>
73ForwardDriveModule::forward_curvature(
float dist_to_target,
92ForwardDriveModule::forward_translation(
float dist_to_target,
99 if (fabs(alpha) >= M_PI_2) {
134 float trans_target = 10000.f;
135 float trans_front = 10000.f;
141 if (dist_to_front > 0.f && dist_to_front < dist_to_target)
145 des_trans = std::min(des_trans, std::min(trans_target, trans_front));
188 if (dist_to_target >= 0.04) {
200 if (trans_correction < 1.f) {
202 proposed_.
x *= trans_correction * trans_correction;
This is the base class which calculates drive modes.
bool stop_at_target_
flag if stopping on or after target
float max_trans_
The maximum translation speed.
cart_coord_2d_t local_trajec_
local trajectory
float robot_speed_
current robo translation velocity
colli_trans_rot_t robot_vel_
current robot velocity
float max_rot_
The maximum rotation speed.
Configuration * config_
The fawkes configuration.
NavigatorInterface::DriveMode drive_mode_
the drive mode name
colli_trans_rot_t proposed_
proposed translation and rotation for next timestep
float lin_interpol(float x, float left, float right, float bot, float top)
Perform linear interpolation.
float guarantee_trans_stop(float distance, float current_trans, float desired_trans)
Get velocity that guarantees a stop for a given distance.
Logger * logger_
The fawkes logger.
cart_coord_2d_t local_target_
local target
Interface for configuration handling.
virtual float get_float(const char *path)=0
Get value from configuration which is of type float.
ForwardDriveModule(Logger *logger, Configuration *config)
Constructor.
~ForwardDriveModule()
Destructor.
virtual void update()
Calculate here your desired settings.
virtual void log_debug(const char *component, const char *format,...)=0
Log debug message.
@ Forward
Moving forward constant.
@ MovingNotAllowed
Moving not allowed constant.
Fawkes library namespace.
double sqr(double x)
Fast square multiplication.
float x
Translation in x-direction.
float y
Translation in y-direction.
float rot
Rotation around z-axis.