Commit 3720bffe authored by Timothy Stack's avatar Timothy Stack

Local version of the NS "setdest" util, unsupported things like ad-hoc

link changes were stripped out, and it was updated to only generate
points within the camera viewable portion of the robot area (which is
obtained from the rpc server).
parent aef98f9a
...@@ -25,9 +25,10 @@ CXXFLAGS += -pthread ...@@ -25,9 +25,10 @@ CXXFLAGS += -pthread
LDFLAGS = -L/usr/local/lib LDFLAGS = -L/usr/local/lib
LIBS = -lulsshxmlrpcpp -lulxmlrpcpp -lexpat LIBS = -lulsshxmlrpcpp -lulxmlrpcpp -lexpat
LIBS += -L/usr/local/lib -lvin4mt -lvin4c -lvin4 -lssl -lcrypto -lm
tbsetdest: $(OBJS) tbsetdest: $(OBJS)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) $(CXX) -static $(CXXFLAGS) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
install: all install: all
-mkdir -p $(INSTALL_DIR)/opsdir/bin -mkdir -p $(INSTALL_DIR)/opsdir/bin
......
This diff is collapsed.
#ifndef __setdest_h__
#define __setdest_h__
/*#include <sys/queue.h>*/ #ifndef __tbsetdest_h__
#include "../../../config.h" #define __tbsetdest_h__
#include "../../../lib/bsd-list.h"
#include "config.h"
#include <sys/queue.h>
#ifndef LIST_FIRST #ifndef LIST_FIRST
#define LIST_FIRST(head) ((head)->lh_first) #define LIST_FIRST(head) ((head)->lh_first)
...@@ -14,39 +14,39 @@ ...@@ -14,39 +14,39 @@
void ReadInMovementPattern(void); void ReadInMovementPattern(void);
class vector { class sdvector {
public: public:
vector(double x = 0.0, double y = 0.0, double z = 0.0) { sdvector(double x = 0.0, double y = 0.0, double z = 0.0) {
X = x; Y = y; Z = z; X = x; Y = y; Z = z;
} }
double length() { double length() {
return sqrt(X*X + Y*Y + Z*Z); return sqrt(X*X + Y*Y + Z*Z);
} }
inline void vector::operator=(const vector a) { inline void sdvector::operator=(const sdvector a) {
X = a.X; X = a.X;
Y = a.Y; Y = a.Y;
Z = a.Z; Z = a.Z;
} }
inline void vector::operator+=(const vector a) { inline void sdvector::operator+=(const sdvector a) {
X += a.X; X += a.X;
Y += a.Y; Y += a.Y;
Z += a.Z; Z += a.Z;
} }
inline int vector::operator==(const vector a) { inline int sdvector::operator==(const sdvector a) {
return (X == a.X && Y == a.Y && Z == a.Z); return (X == a.X && Y == a.Y && Z == a.Z);
} }
inline int vector::operator!=(const vector a) { inline int sdvector::operator!=(const sdvector a) {
return (X != a.X || Y != a.Y || Z != a.Z); return (X != a.X || Y != a.Y || Z != a.Z);
} }
inline vector operator-(const vector a) { inline sdvector operator-(const sdvector a) {
return vector(X-a.X, Y-a.Y, Z-a.Z); return sdvector(X-a.X, Y-a.Y, Z-a.Z);
} }
friend inline vector operator*(const double a, const vector b) { friend inline sdvector operator*(const double a, const sdvector b) {
return vector(a*b.X, a*b.Y, a*b.Z); return sdvector(a*b.X, a*b.Y, a*b.Z);
} }
friend inline vector operator/(const vector a, const double b) { friend inline sdvector operator/(const sdvector a, const double b) {
return vector(a.X/b, a.Y/b, a.Z/b); return sdvector(a.X/b, a.Y/b, a.Z/b);
} }
double X; double X;
...@@ -93,9 +93,9 @@ private: ...@@ -93,9 +93,9 @@ private:
u_int32_t index; // unique node identifier u_int32_t index; // unique node identifier
u_int32_t first_trip; // 1 if first trip, 0 otherwise. (by J. Yoon) u_int32_t first_trip; // 1 if first trip, 0 otherwise. (by J. Yoon)
vector position; // current position sdvector position; // current position
vector destination; // destination sdvector destination; // destination
vector direction; // computed from pos and dest sdvector direction; // computed from pos and dest
double speed; double speed;
double time_update; // when pos last updated double time_update; // when pos last updated
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment