4 #define STEPS_UNTIL_GOAL_REACHED 20 10 ROS_DEBUG(
"port: %s, baud: %d, speeControl: %d", port, baud, speedControl);
26 int pan_upper,
int tilt_upper,
27 int pan_accel,
int tilt_accel,
28 int pan_hold,
int tilt_hold,
29 int pan_move,
int tilt_move)
43 ROS_DEBUG(
"double panMin:%f, double panMax:%f", pan_min, pan_max);
44 ROS_DEBUG(
"double tiltMin:%f, double tiltMax:%f", tilt_min, tilt_max);
53 ROS_DEBUG(
"double pan_speed:%f, double tilt_speed:%f", pan_speed, tilt_speed);
60 ROS_ERROR(
"This mock function should not be used");
65 ROS_ERROR(
"PAN and TILT lie within forbidden area");
69 ROS_ERROR(
"PAN/TILT out of pan/tilt bounds");
73 ROS_DEBUG(
"double pan_angle:%f, double tilt_angle:%f", pan_angle, tilt_angle);
80 ROS_INFO(
"Successfull set Pan and Tilt. PAN: %f, TILT: %f\n", pan_angle, tilt_angle);
179 n.
getParam(
"mock_pan_min_hardware_limit", pan_min_limit);
180 n.
getParam(
"mock_pan_max_hardware_limit", pan_max_limit);
181 n.
getParam(
"mock_tilt_min_hardware_limit", tilt_min_limit);
182 n.
getParam(
"mock_tilt_max_hardware_limit", tilt_max_limit);
189 ROS_DEBUG(
"pan_min_limit: %f, pan_max_limit: %f, tilt_min_limit: %f, tilt_max_limit: %f", pan_min_limit, pan_max_limit, tilt_min_limit, tilt_max_limit);
195 ROS_ERROR(
"DO NOT USE determineLegitEndPoint WITH PTU DRIVER MOCK");
196 ROS_ERROR(
"Maybe you enabled path_prediction in one of the launch files you use. Path prediction is not intended to be used with the mock launch files");
197 std::vector<double> dummy;
198 dummy.push_back(end_point_pan_candidate);
199 dummy.push_back(end_point_tilt_candidate);
204 ROS_DEBUG(
"PAN: %f, TILT: %f\n", *pan, *tilt);
209 double pan_initial = *pan;
210 double tilt_initial = *tilt;
213 ROS_WARN(
"PAN was out of limits, but within margin, so instead of the initial value %f the value %f is used", pan_initial, *pan);
217 ROS_WARN(
"PAN was out of limits, but within margin, so instead of the initial value %f the value %f is used", pan_initial, *pan);
221 ROS_WARN(
"TILT was out of limits, but within margin, so instead of the initial value %f the value %f is used", tilt_initial, *tilt);
225 ROS_WARN(
"TILT was out of limits, but within margin, so instead of the initial value %f the value %f is used", tilt_initial, *tilt);
229 ROS_DEBUG(
"PAN: %f, TILT: %f\n", *pan, *tilt);
240 if(pan_or_tilt ==
'p') {
241 if (upper_or_lower ==
'l') {
244 else if (upper_or_lower ==
'u') {
248 return std::numeric_limits<double>::max();
251 else if (pan_or_tilt ==
't') {
252 if (upper_or_lower ==
'l') {
255 else if (upper_or_lower ==
'u') {
259 return std::numeric_limits<double>::max();
263 return std::numeric_limits<double>::max();
virtual double getAngleSpeed(char type)
getAngleSpeed Method to get the current angle speed of an axisa (deg/s)
virtual bool hasHaltedAndReachedGoal()
hasHaltedAndReachedGoal Method to determine if the PTU has halted and reached its goal ...
#define STEPS_UNTIL_GOAL_REACHED
virtual void setAbsoluteAngleSpeeds(double pan_speed, double tilt_speed)
setAbsoluteAngleSpeeds Method to set desired speed for pan/tilt movement absolute in deg/s ...
virtual void setSettings(int pan_base, int tilt_base, int pan_speed, int tilt_speed, int pan_upper, int tilt_upper, int pan_accel, int tilt_accel, int pan_hold, int tilt_hold, int pan_move, int tilt_move)
setSettings Method to configure various settings of the ptu
virtual void setSpeedControlMode(bool speed_control_mode)
setSpeedControlMode Method to set and disable pure speed control mode
PTUDriverMock(const char *port, int baud, bool speed_control)
bool isConnected()
isConnected Method to check if ptu is connected.
virtual bool isWithinPanTiltLimits(double pan, double tilt)
isWithinPanTiltLimits Method that checks if pan and tilt value are within the chosen pan and tilt lim...
virtual bool hasHalted()
hasHalted Method to determine if PTU movement has stopped
virtual bool setAbsoluteAngles(double pan_angle, double tilt_angle, bool no_forbidden_area_check)
setAbsoluteAngles Method to set pan and tilt angle for the PTU
virtual bool reachedGoal()
reachedGoal Method to determine if the PTU has reached its goal.
virtual double getDesiredAngle(char type)
getDesiredAngle Method to get the desired pan/tilt angle (where the ptu moves to) ...
virtual void setLimitAngles(double pan_min, double pan_max, double tilt_min, double tilt_max)
setSettings Method to configure limits for pan and tilt
virtual void setLimitAnglesToHardwareConstraints()
setLimitAnglesToHardwareConstraints Method that sets the pan and tilt limits to the maximum values th...
virtual bool setValuesOutOfLimitsButWithinMarginToLimit(double *pan, double *tilt, double margin)
setValuesOutOfLimitsButWithinMarginToLimit This method is used to set pan/tilt values that are slighl...
virtual long getLimitAngle(char pan_or_tilt, char upper_or_lower)
!!!!!!!!!Müssen nachfolgende public sein? Nach erstellen von mock überprüfen!!!!!!!!!!! ...
bool getParam(const std::string &key, std::string &s) const
virtual bool isInSpeedControlMode()
isInSpeedControlMode Method to determine if ptu is in pure speed control mode
virtual bool isInForbiddenArea(double pan_angle, double tilt_angle)
isInForbiddenArea method to determine if a pan + tilt value pair lies within a forbidden area...
virtual double getCurrentAngle(char type)
getCurrentAngle Method to get the current pan/tilt angle
virtual std::vector< double > determineLegitEndPoint(double end_point_pan_candidate, double end_point_tilt_candidate)
determineLegitEndPoint DO NOT USE, NOT SUPPORTED IN MOCK