Commit 54c28883 authored by David Johnson's avatar David Johnson

Account for fiducial offset in vmc-client.c. Some changes to mezzanine

color configs; also handle more total fiducials per camera (limit had been
6 -- too low with checker fiducials added).  Also add offset information
for vmc-client configs.
parent fedf874f
-x 5.939 -y 8.499 -z 2.3 -o -1.5707
-x 2.681 -y 2.506 -z 2.3 -o -1.5707 -H 0.113 -r /var/log/snapvideo0
-x 7.963 -y 8.160 -z 2.17 -o -1.5707
-x 4.716 -y 2.162 -z 2.17 -o -1.5707 -H 0.113 -r /var/log/snapvideo1
-x 9.964 -y 8.152 -z 2.16 -o -1.5707
-x 6.718 -y 2.153 -z 2.16 -o -1.5707 -H 0.113 -r /var/log/snapvideo2
-x 11.980 -y 8.137 -z 2.295 -o -1.5707
-x 8.732 -y 2.133 -z 2.295 -o -1.5707 -H 0.113 -r /var/log/snapvideo3
-x 4.945 -y 10.942 -z 2.305
-x 1.69 -y 4.942 -z 2.305 -H 0.113 -r /var/log/snapvideo2
-x 4.952 -y 12.773 -z 2.3075
-x 1.692 -y 6.775 -z 2.3075 -H 0.113 -r /var/log/snapvideo3
......@@ -93,7 +93,7 @@ dewarp.ipos[8] = (455, 41)
# Object identification
ident.object_count = 6
ident.object_count = 10
ident.max_disp = 0.10
ident.max_sep = 0.15
ident.max_missed = 1
......
......@@ -36,14 +36,14 @@ classify.class[1].vupoly[0] = (209, 37)
classify.class[1].vupoly[1] = (189, 176)
classify.class[1].vupoly[2] = (151, 164)
classify.class[1].vupoly[3] = (133, 83)
classify.class[1].yupoly[0] = (218, 115)
classify.class[1].yupoly[1] = (92, 125)
classify.class[1].yupoly[0] = (217, 120)
classify.class[1].yupoly[1] = (56, 123)
classify.class[1].yupoly[2] = (54, 77)
classify.class[1].yupoly[3] = (201, 66)
classify.class[1].vypoly[0] = (198, 206)
classify.class[1].vypoly[1] = (190, 54)
classify.class[1].vypoly[2] = (133, 4)
classify.class[1].vypoly[3] = (163, 203)
classify.class[1].vypoly[2] = (124, -5)
classify.class[1].vypoly[3] = (164, 199)
# Blob finder
......@@ -93,7 +93,7 @@ dewarp.ipos[8] = (503, 52)
# Object identification
ident.object_count = 6
ident.object_count = 10
ident.max_disp = 0.10
#ident.max_sep = 0.20
ident.max_sep = 0.095
......
......@@ -93,7 +93,7 @@ dewarp.ipos[8] = (436, 35)
# Object identification
ident.object_count = 6
ident.object_count = 10
ident.max_disp = 0.10
ident.max_sep = 0.095
ident.max_missed = 1
......
......@@ -93,7 +93,7 @@ dewarp.ipos[8] = (458, 94)
# Object identification
ident.object_count = 6
ident.object_count = 10
ident.max_disp = 0.20
ident.max_sep = 0.100
ident.max_missed = 1
......
......@@ -21,28 +21,28 @@ classify.class[0].vupoly[0] = (112, 94)
classify.class[0].vupoly[1] = (137, 178)
classify.class[0].vupoly[2] = (68, 161)
classify.class[0].vupoly[3] = (71, 92)
classify.class[0].yupoly[0] = (14, 109)
classify.class[0].yupoly[1] = (222, 130)
classify.class[0].yupoly[2] = (235, 169)
classify.class[0].yupoly[3] = (9, 145)
classify.class[0].vypoly[0] = (94, 73)
classify.class[0].vypoly[1] = (117, 72)
classify.class[0].vypoly[2] = (123, 242)
classify.class[0].yupoly[0] = (42, 133)
classify.class[0].yupoly[1] = (233, 130)
classify.class[0].yupoly[2] = (225, 167)
classify.class[0].yupoly[3] = (47, 148)
classify.class[0].vypoly[0] = (91, 70)
classify.class[0].vypoly[1] = (118, 48)
classify.class[0].vypoly[2] = (125, 239)
classify.class[0].vypoly[3] = (65, 227)
classify.class[1].name = pink
classify.class[1].color = (255, 105, 180)
classify.class[1].vupoly[0] = (205, 55)
classify.class[1].vupoly[0] = (197, 37)
classify.class[1].vupoly[1] = (198, 161)
classify.class[1].vupoly[2] = (146, 157)
classify.class[1].vupoly[3] = (144, 99)
classify.class[1].yupoly[0] = (209, 132)
classify.class[1].yupoly[1] = (143, 145)
classify.class[1].yupoly[2] = (27, 87)
classify.class[1].yupoly[3] = (156, 48)
classify.class[1].yupoly[0] = (201, 116)
classify.class[1].yupoly[1] = (108, 131)
classify.class[1].yupoly[2] = (93, 63)
classify.class[1].yupoly[3] = (170, 65)
classify.class[1].vypoly[0] = (197, 190)
classify.class[1].vypoly[1] = (212, 61)
classify.class[1].vypoly[2] = (138, 37)
classify.class[1].vypoly[2] = (143, 14)
classify.class[1].vypoly[3] = (142, 230)
......@@ -56,6 +56,7 @@ blobfind.max_sizey = 30
# Dewarp parameters
dewarp.cameraCenter = (295,217)
# (?)
dewarp.cameraCheck = (515,384)
dewarp.ocHeight = 2.305
dewarp.scaleFactor = (179.0,184.0)
......@@ -92,7 +93,7 @@ dewarp.ipos[8] = (521, 77)
# Object identification
ident.object_count = 6
ident.object_count = 10
ident.max_disp = 0.10
ident.max_sep = 0.15
ident.max_missed = 1
......
......@@ -93,7 +93,7 @@ dewarp.ipos[8] = (526, 81)
# Object identification
ident.object_count = 6
ident.object_count = 10
ident.max_disp = 0.10
ident.max_sep = 0.15
ident.max_missed = 1
......
......@@ -100,6 +100,9 @@ static struct robot_position offsets;
static double z_offset = 0.0;
/* This is a fiducial offset, perpendicular to robot axis. */
static double fiducial_offset = 0.0;
static mezz_mmap_t *recorded_frames[RECORD_FRAME_COUNT];
static char *recordpath = "/var/log/mezzframe";
......@@ -128,6 +131,7 @@ static void usage(void)
" -y offset\ty offset from real world y = 0 to our local y = 0\n"
" -z offset\tz offset from\n"
" -o orientation\tcamera orientation\n"
" -H offset\tFiducial offset, perpendicular to robot axis\n"
#if !defined(HAVE_MEZZANINE)
" -f file\tFile to read simulated positions from.\n"
#endif
......@@ -174,7 +178,19 @@ static void sigusr1(int signal)
mezz_frame_count += 1;
}
#define ROBOT_HEIGHT 0.12f
#define ROBOT_HEIGHT 0.16f
void fiducial_offset_trans(struct robot_position *pio) {
/* float hyp, theta; */
/* struct robot_position rp; */
/* rp = *pio; */
/* mtp_polar(NULL,&rp,&hyp,&theta); */
pio->x = pio->x + fiducial_offset*cosf(pio->theta);
pio->y = pio->y - fiducial_offset*sinf(pio->theta);
}
void radial_trans(struct robot_position *p_inout)
{
......@@ -309,7 +325,11 @@ static int encode_packets(mezz_mmap_t *mm)
/* ... transform them into global coordinates. */
local2global_posit_trans(&(mup->position));
if (fiducial_offset != 0.0f) {
fiducial_offset_trans(&(mup->position));
}
if (lpc == last_idx_set) {
/*
* Mark the end of updates for this frame so that vmcd can
......@@ -380,7 +400,7 @@ int main(int argc, char *argv[])
xdrrec_create(&xdr, 0, 0, NULL, NULL, mem_write);
while ((c = getopt(argc, argv, "hdr:p:l:i:f:x:y:z:o:")) != -1) {
while ((c = getopt(argc, argv, "hdr:p:l:i:f:x:y:z:o:H:")) != -1) {
switch (c) {
case 'h':
usage();
......@@ -442,6 +462,13 @@ int main(int argc, char *argv[])
exit(1);
}
break;
case 'H':
if (sscanf(optarg,"%lf",&fiducial_offset) != 1) {
error("error: -H option is not a number: %s\n", optarg);
usage();
exit(1);
}
break;
default:
break;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment