50 : TclClass(
"Position/UWSM")
82 Tcl &tcl = Tcl::instance();
84 if (strcasecmp(argv[1],
"setdest") == 0) {
86 cerr << NOW <<
"UWSMPosition::command(setdest, " << argv[2]
87 <<
", " << argv[3] <<
", " << argv[4] <<
", " << argv[5]
89 setdest(atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]));
92 }
else if (argc == 5) {
93 if (strcasecmp(argv[1],
"setdest") == 0) {
95 cerr << NOW <<
"UWSMPosition::command(setdest, " << argv[2]
96 <<
", " << argv[3] <<
", " << argv[4] <<
")" << endl;
97 setdest(atof(argv[2]), atof(argv[3]), atof(argv[4]));
100 }
else if (argc == 2) {
101 if (strcasecmp(argv[1],
"update") == 0) {
102 double now = Scheduler::instance().clock();
107 return Position::command(argc, argv);
112 double x_dest,
double y_dest,
double z_dest,
double spead_setted)
114 double now = Scheduler::instance().clock();
119 cerr <<
"Warning: calling set dest at time < 0 will not work" << endl;
128 printf(
"UWSMPosition::setdest pos (%f,%f,%f), dest(%f,%f,%f), "
129 "source(%f,%f,%f), speed %f\n",
145 double now = Scheduler::instance().clock();
150 cerr <<
"Warning: calling set dest at time < 0 will not work" << endl;
158 printf(
"UWSMPosition::setdest pos (%f,%f,%f), dest(%f,%f,%f), "
159 "source(%f,%f,%f), speed %f\n",
181 if (theta_den == 0) {
205 printf(
"New pos (%f,%f,%f), dest(%f,%f,%f), source(%f,%f,%f), "
206 "speed %f sen(%f)=%f\n",
227 double dist = std::sqrt(pow(
Xdest_ - x_, 2.0) + pow(
Ydest_ - y_, 2.0) +
230 if (std::fabs(dist) < 1e-6)
239 double now = Scheduler::instance().clock();
269 double now = Scheduler::instance().clock();
278 double now = Scheduler::instance().clock();
TclObject * create(int, const char *const *)
virtual void setY(double y)
double lastUpdateTime_
time in which the TCL command setdest is invoked
virtual ~UWSMPosition()
Destructor.
int debug_
speed of the node
virtual double getY()
Method that return the current projection of the node on the y-axis.
virtual double getX()
Method that return the current projection of the node on the x-axis.
virtual bool isDestReached() const
virtual int command(int argc, const char *const *argv)
TCL command interpreter setdest <integer value>integer value>integer value>: set the movement pattern...
virtual void setZ(double z)
UWSMPosition()
Constructor.
virtual void update(double now)
Method that updates both the position coordinates.
double getSpeed() const
Method that return the actual speed.
virtual double getZdest() const
Method that return the z cooridnate of the destination point.
virtual double getYdest() const
Method that return the y cooridnate of the destination point.
double speed_
position on the z-axis of the starting point (when the TCL command setdest is invoked)
virtual double getZ()
Method that return the current projection of the node on the z-axis.
double Zdest_
position on the y-axis of the destination point
virtual void setX(double x)
virtual double getXdest() const
Method that return the x cooridnate of the destination point.
double Xdest_
time last updated of the coordinates was computed
double Ydest_
position on the x-axis of the destination point
double Xsorg_
position on the z-axis of the destination point
double Zsorg_
position on the y-axis of the starting point (when the TCL command setdest is invoked)
virtual void setdest(double x_dest, double y_dest, double z_dest, double spead)
double Ysorg_
position on the x-axis of the starting point (when the TCL command setdest is invoked)
UWSMPositionClass class_uwsmposition
Provides the definition of the class UWSMPosition.