-export TARGET=roomba_test
-export SOURCES=main.cc
-export CXXFLAGS=-I/usr/include/qt4 -I/usr/include/qt4/QtCore \
- -I/usr/include/qt4/QtGui -lQtGui \
- -I/usr/include/ -I/usr/include/QtCore \
- -I/usr/include/QtGui -lQtGui
+WISELIB_PATH=../..
+WISELIB_STABLE=$(WISELIB_PATH)/wiselib.stable
+WISELIB_TESTING=$(WISELIB_PATH)/wiselib.testing
+QTCXXFLAGS=-I/usr/include/qt4 -I/usr/include/qt4/QtCore \
+ -I/usr/include/qt4/QtGui -I/usr/include/QtCore -I/usr/include/QtGui \
+ -lQtGui
+
+CXX=g++
+LD=ld
+CXXFLAGS=-I$(WISELIB_STABLE) -I$(WISELIB_TESTING) -lpthread
+LDFLAGS=
all: roomba_test battery_test
clean:
- rm -f battery_test $(TARGET)
+ rm -f roomba_test battery_test svnrevision.h
+
+svnrevision.h:
+ ./svnrevision.sh
-include ../Makefile.base
+roomba_test: main.cc svnrevision.h
+ $(CXX) $(CXXFLAGS) $< -o $@ $(QTCXXFLAGS)
battery_test: battery_test.cc
- $(CXX) -I$(WISELIB_STABLE) -I$(WISELIB_TESTING) -lpthread -o battery_test battery_test.cc
+ $(CXX) $(CXXFLAGS) $< -o $@
+# vim: noexpandtab :
* THE SOFTWARE.
*/
-//#include "main.h"
+#include "svnrevision.h"
#include <iostream>
#include <stdint.h>
-//#include <unistd.h>
-//#include "util/standalone_math.h"
-//#include "util/delegates/delegate.hpp"
#include <external_interface/pc/pc_os_model.h>
#include <external_interface/pc/pc_com_uart.h>
#include <external_interface/pc/pc_timer.h>
+ "Input travelled distance on y axis in mm:", deviation_y,
numeric_limits<int>::min(), numeric_limits<int>::max(), 1, &ok);
if(ok) {
- cout << "input_distance=" << input_distance << " velocity=" << velocity
- << " internal_distance=" << roomba.distance() << " deviation_x="
- << deviation_x << " deviation_y=" << deviation_y
- << " encoder_ticks_left=" << sensor_data.left_encoder_counts
- << " encoder_ticks_right=" << sensor_data.right_encoder_counts
- << " batt_charge=" << sensor_data.charge << " batt_capacity="
- << sensor_data.capacity << " batt_voltage=" << sensor_data.voltage
- << " batt_current=" << sensor_data.current << endl;
+ cout << "svn=" << SVNREVISION << " input_distance=" << input_distance
+ << " velocity=" << velocity << " internal_distance="
+ << roomba.distance() << " deviation_x=" << deviation_x
+ << " deviation_y=" << deviation_y << " encoder_ticks_left="
+ << sensor_data.left_encoder_counts << " encoder_ticks_right="
+ << sensor_data.right_encoder_counts << " batt_charge="
+ << sensor_data.charge << " batt_capacity=" << sensor_data.capacity
+ << " batt_voltage=" << sensor_data.voltage << " batt_current="
+ << sensor_data.current << endl;
} else {
break;
}
--- /dev/null
+#!/bin/bash
+
+revision=$(svn info|grep Revision|sed 's/Revision: //')
+
+if [ -n "$(svn status|grep '^M')" ]; then
+ status=" with local changes"
+else
+ status=""
+fi;
+
+echo '// This file is created automatically, your changes will be lost.' > svnrevision.h
+echo '#define SVNREVISION "r'$revision$status'"' >> svnrevision.h
+