cornslib_SOURCES = corns_configs.c
# Libraries linked to all programs in this Makefile
-lib_LOADLIBES = robot mcl robomath roboorte robottype \
+lib_LOADLIBES = robot sercom mcl robomath roboorte robottype \
pthread rt m orte pathplan sharp map fsm \
rbtree motion robodim actlib cornslib
#include <robomath.h>
#include <mcl_robot.h>
#include <string.h>
+#include <unistd.h>
#if 0
struct TrajectoryConstraints trajectoryConstraintsDefault = {
// right, r //robot.orte.motion_speed.right
// );
ORTEPublicationSend(robot.orte.publication_motion_speed);
+ char s[50];
+ sprintf(s, "SPDA:%d\nSPDB:%d\n", r, -l);
+ printf(s);
+ write(robot.motory.fd, s, strlen(s));
}
/**
rv = robot_init_orte();
act_init(&robot.orte);
+ strcpy((char *)&robot.motory.devname, "/dev/ttyUSB0");
+ robot.motory.baudrate = 19200;
+ robot.motory.parity = SERCOM_PARNONE;
+ robot.motory.databits = 8;
+ robot.motory.stopbits = 1;
+ robot.motory.mode = 0;
+ robot.motory.sighandler = NULL;
+ rv = sercom_open(&robot.motory);
+ printf("RRRRRRRRRRRRRRRRRRRR %d\n", rv);
+ perror("sercom_open");
+
return rv;
}
#include <roboevent.h>
#include <fsm.h>
#include <robot_config.h>
+#include <sercom.h>
/**
* Competition parameters
/** is set to true in separate thread when there is short time left */
bool short_time_to_end;
bool check_turn_safety;
+ struct sercom_data motory;
}; /* robot */
extern struct robot robot;
# Libraries linked to all programs in this Makefile
lib_LOADLIBES = robot mcl robodim laser-nav robomath \
roboorte robottype pthread rt m orte pathplan \
- sharp map fsm rbtree motion actlib cornslib
+ sharp map fsm rbtree motion actlib cornslib sercom
#include <termios.h>
#include <sys/types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#define _POSIX_SOURCE 1 /* POSIX compliant source */
#define SERCOM_DEFAULT_DEV "/dev/ttyS0"
#define SERCOM_DEVNAME_LEN 80
ssize_t sercom_read(struct sercom_data *sercom, char *buf, ssize_t buflen);
void sercom_close(struct sercom_data *sercom);
+#ifdef __cplusplus
+}
+#endif
+
+
#endif