CONFIG_CLOCK_THREAD=n
# turn on timestamping for individual parts of SW
CONFIG_TIMING_MOTION_CONTROL=y
+CONFIG_TIMING_MOTION_ESTIMATION=y
# timestamping method - choose only one!
CONFIG_TIMING_IPOINT_ASM=y
CONFIG_TIMING_IPOINT_CLOCK_GETTIME=n
#include <map.h>
#include "robot_config.h"
#include <robomath.h>
+#include <sys/syscall.h>
#define MOTION_CONTROL
#include "motion-control.h"
#include <geom.h>
/* Timing analysis */
-#ifdef CONFIG_TIMING_MOTION_CONTROL
+#ifdef CONFIG_TIMING_ANALYSIS
#include <timing.h>
#endif
real_t x[8], P[8*8];
int i, odo_received, err[5];
+#ifdef CONFIG_TIMING_ANALYSIS
+#ifdef CONFIG_TIMING_MOTION_ESTIMATION
+ timing_ipoint(IPOINT_MOTION_DO_ESTIMATION_IN);
+#endif
+#endif
+
#ifdef WE_ARE_RED
robot.team_color = RED;
#else
robot.est_pos_uzv.y = x[1] - ODO_D*sin(x[6]);
robot.est_pos_uzv.phi = x[6];
ROBOT_UNLOCK(est_pos_uzv);
+#ifdef CONFIG_TIMING_ANALYSIS
+#ifdef CONFIG_TIMING_MOTION_ESTIMATION
+ timing_ipoint(IPOINT_MOTION_DO_ESTIMATION_OUT);
+#endif
+#endif
}
static void do_control()
// Calculate reference position
/***FIXME:should not rely on system clock, the period is fixed***/
+#ifdef CONFIG_TIMING_ANALYSIS
#ifdef CONFIG_TIMING_MOTION_CONTROL
timing_ipoint(IPOINT_MOTION_DO_CONTROL_IN);
+#endif
#endif
gettimeofday(&tv, NULL);
t = (double)(tv.tv_usec - tv_start.tv_usec) / 1000000.0;
robot_send_speed(speedl, speedr);
pthread_mutex_unlock(&actual_trajectory_lock);
+#ifdef CONFIG_TIMING_ANALYSIS
#ifdef CONFIG_TIMING_MOTION_CONTROL
timing_ipoint(IPOINT_MOTION_DO_CONTROL_OUT);
#endif
+#endif
}
void dummy_handler(int)
struct timespec next;
int ret;
+#ifdef CONFIG_TIMING_ANALYSIS
+ timing_set_pid(syscall(SYS_gettid));
+#endif
clock_gettime(CLOCK_REALTIME, &next);
while (1) {