47 : TclClass(
"Position/UWSM")
76 if (strcasecmp(argv[1],
"setdest") == 0) {
78 cerr << NOW <<
"UWSMPosition::command(setdest, " << argv[2]
79 <<
", " << argv[3] <<
", " << argv[4] <<
", " << argv[5]
82 setdest(atof(argv[2]), atof(argv[3]), atof(argv[4]), atof(argv[5]));
86 }
else if (argc == 5) {
87 if (strcasecmp(argv[1],
"setdest") == 0) {
89 cerr << NOW <<
"UWSMPosition::command(setdest, " << argv[2]
90 <<
", " << argv[3] <<
", " << argv[4] <<
")" << endl;
92 setdest(atof(argv[2]), atof(argv[3]), atof(argv[4]));
96 }
else if (argc == 2) {
97 if (strcasecmp(argv[1],
"update") == 0) {
98 double now = Scheduler::instance().clock();
106 return Position::command(argc, argv);
112 double now = Scheduler::instance().clock();
119 cerr <<
"Warning: calling set dest at time < 0 will not work" << endl;
130 printf(
"UWSMPosition::setdest pos (%f,%f,%f), dest(%f,%f,%f), "
131 "source(%f,%f,%f), speed %f\n",
147 double now = Scheduler::instance().clock();
154 cerr <<
"Warning: calling set dest at time < 0 will not work" << endl;
164 printf(
"UWSMPosition::setdest pos (%f,%f,%f), dest(%f,%f,%f), "
165 "source(%f,%f,%f), speed %f\n",
190 if (theta_den == 0) {
219 printf(
"New pos (%f,%f,%f), dest(%f,%f,%f), source(%f,%f,%f), "
220 "speed %f sen(%f)=%f\n",
241 double dist = std::sqrt(pow(
Xdest_ - x_, 2.0)
245 if (std::fabs(dist) < 1e-6)
254 double now = Scheduler::instance().clock();
287 double now = Scheduler::instance().clock();
298 double now = Scheduler::instance().clock();
TclObject * create(int, const char *const *)
virtual void setY(double y) override
Set the projection on y-axis of the node postion.
virtual double getY() override
Get the current projection on y-axis of the node postion If necessary (updating time expired),...
double lastUpdateTime_
Time when last update of the coordinates was computed.
virtual void setZ(double z) override
Set the projection on z-axis of the node postion.
virtual bool isDestReached() const
UWSMPosition()
UWSMPosition constructor.
virtual void update(double now)
Update both the current position coordinates.
virtual double getX() override
Get the current projection on x-axis of the node postion If necessary (updating time expired),...
double getSpeed() const
Get the current speed of the node.
virtual double getZdest() const
Get the z coordinate of the destination point.
virtual double getYdest() const
Get the y coordinate of the destination point.
double speed_
Speed of the node.
virtual void setdest(double x_dest, double y_dest, double z_dest, double speed)
virtual int command(int argc, const char *const *argv) override
TCL command interpreter.
double Zdest_
Position along z-axis of the destination point.
double trgTime_
Time when the TCL command setdest is invoked.
virtual void setX(double x) override
Set the projection on x-axis of the node postion.
virtual double getXdest() const
Get the x coordinate of the destination point.
double Xdest_
Position along x-axis of the destination point.
double Ydest_
Position along y-axis of the destination point.
virtual double getZ() override
Get the current projection on z-axis of the node postion If necessary (updating time expired),...
double Xsorg_
Position along x-axis of the starting point.
double Zsorg_
Position along z-axis of the starting point.
double Ysorg_
Position along y-axis of the starting point.
UWSMPositionClass class_uwsmposition
Provides the definition of the class UWSMPosition.