//#define __robot_lock_ lock /* ROBOT_LOCK() */
#define __robot_lock_ref_pos lock_ref_pos
#define __robot_lock_est_pos lock_est_pos
-#define __robot_lock_des_pos lock
#define __robot_lock_joy_data lock_joy_data
#define __robot_lock_meas_angles lock_meas_angles
#define __robot_lock_drives lock
switch (info->status) {
case NEW_DATA: {
+ ROBOT_LOCK(sharps);
+ robot.sharps = *instance;
+ ROBOT_UNLOCK(sharps);
+
update_map(instance);
break;
}
test_PROGRAMS += homologation
homologation_SOURCES = homologation.cc
+test_PROGRAMS += sharpcalib
+sharpcalib_SOURCES = sharpcalib.cc
+
# Libraries linked to all programs in this Makefile
lib_LOADLIBES = robot_eb2008 mcl robodim_eb2008 laser-nav robomath uoled oledlib sercom roboorte_generic roboorte_eb2008 \
robottype robottype_eb2008 pthread \
--- /dev/null
+
+#define FSM_MAIN
+#include <robot_eb2008.h>
+#include <movehelper_eb2008.h>
+#include <trgen.h>
+#include <robomath.h>
+
+FSM_STATE(init)
+{
+ static int cm = 100;
+ switch (FSM_EVENT) {
+ case EV_ENTRY:
+ robot_set_est_pos_trans(1, 0.5, DEG2RAD(180));
+ FSM_TIMER(1000);
+ break;
+ case EV_TIMER:
+ case EV_MOTION_DONE:
+ printf("%3d cm: sharp left: %5.3f right: %5.3f\n", cm, robot.sharps.front_left, robot.sharps.front_right);
+ robot_move_by(0.01, NO_TURN(), NULL);
+ cm--;
+ if (cm == 0)
+ robot_exit();
+ break;
+ default:
+ break;
+ }
+}
+
+
+int main()
+{
+ /* robot initialization */
+ robot_init();
+
+ robot.fsm[FSM_ID_MAIN].state = &fsm_state_main_init;
+
+ /* Start threads and wait */
+ robot_start();
+ robot_wait();
+
+ /* clean up */
+ robot_destroy();
+
+ return 0;
+}