--- a
+++ b/bibabot.h
@@ -0,0 +1,86 @@
+#include <vector>
+#include <string>
+using namespace std;
+#include <limits.h>
+#include <myhttp.h>
+#include <laserbird.h>
+
+#define BAD_POS		DBL_MIN
+
+struct bibabot_par {
+	int max_connection_attempts;
+	double max_pos;
+	double max_speed;
+
+	bibabot_par()
+	{
+		max_connection_attempts = 5;
+		max_pos = 50;
+		max_speed = 50;
+	}
+};
+
+struct bibabot_cal_par {
+	double amplitude;
+	double speed;
+	double duration_security;
+	int n_cycles;
+	double sample_freq;
+	double min_step;
+	double min_variance_fraction;
+	string debug_file;				// if "", no debug information written
+
+	bibabot_cal_par()
+	{
+		amplitude = 50;
+		speed = 10;
+		duration_security = 1.2;
+		n_cycles = 1;
+		sample_freq = 100;
+		min_step = 0.1;
+		min_variance_fraction = 0.99;
+		debug_file = "";
+	}
+};
+
+class bibabot {
+public:
+	bibabot()									{ bibabot_par par; init(par); }
+	bibabot(const bibabot_par &par)				{ init(par); }
+	~bibabot()									{ cleanup(); }
+
+	bool send(const string &cmd);		// asynchronous version
+	bool ready();
+	bool result(vector<double> &data, double *ptime = 0);
+	bool send(const string &cmd, vector<double> &data, double *ptime = 0);	// synchronous version
+	bool send_sync(const string &cmd, double *ptime = 0);	// synchronous version, when return data isn't required
+
+	bool calibrate();
+	bool calibrate(const bibabot_cal_par &par);
+
+	bool is_moving(bool *pmove = 0);
+	void wait_until_stop();
+
+	double pos();						// the laserbird scalar position, using calibration (BAD_POS otherwise, or if there's a problem)
+	bool pos(double *pz, v3 *praw = 0);
+	bool move(double position, double speed, bool async = false);			// position specified in LaserBird space, sign of speed ignored
+
+	void orientation_reset();
+	double orientation_deviation();
+
+private:
+	void init(const bibabot_par &par);
+	void cleanup();
+	bool get_data(const string &in, string &comment, vector<double> &data);
+
+	bool move_raw(double position, double velocity, bool async = true);		// only uses robot odometers; everything in cm
+	double robot_pos();
+
+	bibabot_par _par;
+	myhttp *_phttp;
+	laserbird *_pbird;
+	bool _calibrated;
+	v3 _calib_dir;
+	v3 _calib_zero;
+	m3 _init_orient;
+};