]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
sick-tim3xx: Add sick dimensions and basic macros
authorMatous Pokorny <matous.pokorny@me.com>
Fri, 28 Sep 2012 13:05:20 +0000 (15:05 +0200)
committerMatous Pokorny <matous.pokorny@me.com>
Fri, 28 Sep 2012 13:05:20 +0000 (15:05 +0200)
src/robodim/robodim.h
src/sick-tim3xx/Makefile.omk
src/sick-tim3xx/sick.h [new file with mode: 0644]

index 4d82b9d3a2934c839b4356f9712eb4e16deedd18..85d8922ff5a4593d3b93546eedaec37bbcb02909 100644 (file)
 #define HOKUYO_RANGE_ANGLE_RIGHT 70.0
 #define HOKUYO_ORIENTATION       (1)   /* 1 = screws up, -1 = screws down */
 
+#define SICK_CENTER_OFFSET_MM         180.0
+#define SICK_CENTER_OFFSET_M  (SICK_CENTER_OFFSET_MM/1000.0)
+#define SICK_RANGE_ANGLE_LEFT  135.0     /* view angle in degrees from center axis */
+#define SICK_RANGE_ANGLE_RIGHT 135.0
+#define SICK_ORIENTATION       (-1)   /* 1 = screws up, -1 = screws down */
+
 #define ODOMETRY_WHEEL_RADIUS_MM 30.0
 #define ODOMETRY_WHEEL_RADIUS_M (ODOMETRY_WHEEL_RADIUS_MM/1000.0)
 #define ODOMETRY_ROTATION_RADIUS_MM (284.0/2.0)
index 49ee6b4898fdd22773af562d78571e51d869c430..a05a5e34f346933b9639aab3db327d9659dcb70e 100644 (file)
@@ -4,6 +4,8 @@
 INCLUDES += $(shell pkg-config libusb-1.0 --cflags)
 LDFLAGS += $(shell pkg-config libusb-1.0 --libs)
 
+include_HEADERS = sick.h
+
 test_PROGRAMS = test_sick
 test_sick_SOURCES = tim3xx_example.c
 
@@ -12,3 +14,4 @@ sickd_SOURCES = sickd.c
 
 lib_LOADLIBES = roboorte robottype orte
 
+
diff --git a/src/sick-tim3xx/sick.h b/src/sick-tim3xx/sick.h
new file mode 100644 (file)
index 0000000..7614c18
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef SICK_H
+#define SICK_H
+
+#include <math.h>
+#include <robottype.h>
+
+#define SICK_ARRAY_SIZE (sizeof(((struct sick_scan_type*)0)->data) / sizeof(((struct sick_scan_type*)0)->data[0]))
+
+#define SICK_START_ANGLE (270.00/2)
+#define SICK_SPLIT_DIVISION     360
+
+#define SICK_INDEX_TO_DEG(x) ((SICK_START_ANGLE-(x)*360.0/SICK_SPLIT_DIVISION) * SICK_ORIENTATION)
+#define SICK_INDEX_TO_RAD(x) (HOKUYO_INDEX_TO_DEG(x)/180.0*M_PI)
+
+#define SICK_DEG_TO_INDEX(d) ((SICK_START_ANGLE-(d))/(360.0/SICK_SPLIT_DIVISION))
+
+#endif //SICK_H