blob: 16f728732de3a52c1e4f503905a304ea8a96a2fa [file] [log] [blame]
Michael Schuh5a1a7582019-03-01 13:03:47 -08001# To build and deploy the image_streamer code to the ODROID, run
2# ./deploy.sh 10.9.71.179
3# This will also configure and copy a supervisor configuration
4# file, vision.conf, to /etc/supervisor/conf.d.
5
6# While the code can work with two cameras, as of March 4, 2019,
7# the robot only has one driver camera on it. To use
8# two cameras, set --single_camera to false. Use the
9# exposure flag to set the camera exposure.
10
11# To view a camera on a Debian laptop use:
12mplayer -tv device=/dev/video0 tv://
13# or if the video is not on video0 try
14mplayer -tv device=/dev/video4 tv://
15# Show available camera formats.
16# This came from https://superuser.com/questions/494575/ffmpeg-open-webcam-using-yuyv-but-i-want-mjpeg
17ffmpeg -f video4linux2 -list_formats all -i /dev/video2
18
19# Jevois notes:
20# To mount a jevois disk on a debian system, use y2019/vision/jevois-cmd
21cd y2019/vision/
22sudo ./jevois-cmd help
23sudo ./jevois-cmd usbsd # This will mount the disk.
24# If needed, install python-serial to run jevois-cmd
25sudo apt-get install python-serial
26
27# Austin debugged the camera startup problems with supervisorctl on the ODROID.
28# Here is a copy of how he did it. The problem was the logging
29# was not starting propery. Austin added a flag to image_streamer
30# so that it would not start logging by default.
31
32root@odroid:~# supervisorctl
33exposure_loop RUNNING pid 625, uptime 0:09:09
34vision FATAL Exited too quickly (process log may have details)
35supervisor> tail -1000 vision stderr
36SURE_ABSOLUTE from 297 to 300
37image_streamer(656)(00018): DEBUG at 0000000021.963290s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_BRIGHTNESS from -3 to -40
38image_streamer(656)(00019): DEBUG at 0000000021.963585s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_GAIN from 16 to 0
39image_streamer(656)(00020): INFO at 0000000021.965102s: aos/vision/image/reader.cc: 277: Init: framerate ended up at 1/30
40image_streamer(656)(00021): INFO at 0000000021.967263s: aos/vision/image/reader.cc: 59: Reader: Bat Vision Successfully Initialized.
41image_streamer(656)(00022): DEBUG at 0000000021.969020s: aos/vision/image/reader.cc: 292: Start: queueing buffers for the first time
42image_streamer(656)(00023): DEBUG at 0000000021.969275s: aos/vision/image/reader.cc: 301: Start: done with first queue
43image_streamer: y2019/vision/image_streamer.cc:60: BlobLog::BlobLog(const char *, const char *): Assertion `ofst_.is_open()' failed.
44
45supervisor> restart vision
46vision: ERROR (not running)
47vision: ERROR (spawn error)
48supervisor> status
49exposure_loop RUNNING pid 625, uptime 0:09:31
50vision STARTING
51supervisor> status
52exposure_loop RUNNING pid 625, uptime 0:09:33
53vision BACKOFF Exited too quickly (process log may have details)
54supervisor> status
55exposure_loop RUNNING pid 625, uptime 0:09:34
56vision BACKOFF Exited too quickly (process log may have details)
57supervisor> tail -1000 vision stderr
58SURE_ABSOLUTE from 297 to 300
59image_streamer(864)(00018): DEBUG at 0000000590.870582s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_BRIGHTNESS from -3 to -40
60image_streamer(864)(00019): DEBUG at 0000000590.870856s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_GAIN from 16 to 0
61image_streamer(864)(00020): INFO at 0000000590.872400s: aos/vision/image/reader.cc: 277: Init: framerate ended up at 1/30
62image_streamer(864)(00021): INFO at 0000000590.874543s: aos/vision/image/reader.cc: 59: Reader: Bat Vision Successfully Initialized.
63image_streamer(864)(00022): DEBUG at 0000000590.876289s: aos/vision/image/reader.cc: 292: Start: queueing buffers for the first time
64image_streamer(864)(00023): DEBUG at 0000000590.876547s: aos/vision/image/reader.cc: 301: Start: done with first queue
65image_streamer: y2019/vision/image_streamer.cc:60: BlobLog::BlobLog(const char *, const char *): Assertion `ofst_.is_open()' failed.
66
67supervisor> tail -1000 vision stdout
68SURE_ABSOLUTE from 297 to 300
69image_streamer(864)(00018): DEBUG at 0000000590.870582s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_BRIGHTNESS from -3 to -40
70image_streamer(864)(00019): DEBUG at 0000000590.870856s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_GAIN from 16 to 0
71image_streamer(864)(00020): INFO at 0000000590.872400s: aos/vision/image/reader.cc: 277: Init: framerate ended up at 1/30
72image_streamer(864)(00021): INFO at 0000000590.874543s: aos/vision/image/reader.cc: 59: Reader: Bat Vision Successfully Initialized.
73image_streamer(864)(00022): DEBUG at 0000000590.876289s: aos/vision/image/reader.cc: 292: Start: queueing buffers for the first time
74image_streamer(864)(00023): DEBUG at 0000000590.876547s: aos/vision/image/reader.cc: 301: Start: done with first queue
75image_streamer: y2019/vision/image_streamer.cc:60: BlobLog::BlobLog(const char *, const char *): Assertion `ofst_.is_open()' failed.
76
77root@odroid:~# /root/image_streamer --single_camera=true --camera0_exposure=600
78image_streamer(890)(00000): INFO at 0000000667.025668s: y2019/vision/image_streamer.cc: 298: main: In main.
79image_streamer(890)(00001): INFO at 0000000667.025722s: y2019/vision/image_streamer.cc: 300: main: before setting up tcp_server.
80image_streamer(890)(00002): INFO at 0000000667.025819s: aos/vision/events/tcp_server.cc: 76: SocketBindListenOnPort: connected to port: 80 on fd: 3
81image_streamer(890)(00003): INFO at 0000000667.025844s: y2019/vision/image_streamer.cc: 302: main: after setting up tcp_server.
82image_streamer(890)(00004): INFO at 0000000667.025872s: y2019/vision/image_streamer.cc: 303: main: In main.
83image_streamer(890)(00005): INFO at 0000000667.025896s: y2019/vision/image_streamer.cc: 305: main: In main.
84image_streamer(890)(00006): INFO at 0000000667.025913s: y2019/vision/image_streamer.cc: 307: main: In main.
85image_streamer(890)(00007): INFO at 0000000667.025933s: y2019/vision/image_streamer.cc: 309: main: In main.
86image_streamer(890)(00008): INFO at 0000000667.025952s: y2019/vision/image_streamer.cc: 311: main: In main.
87image_streamer(890)(00009): INFO at 0000000667.025968s: y2019/vision/image_streamer.cc: 314: main: In main.
88image_streamer(890)(00010): INFO at 0000000667.025985s: y2019/vision/image_streamer.cc: 317: main: In main.
89image_streamer(890)(00011): INFO at 0000000667.026001s: y2019/vision/image_streamer.cc: 319: main: In main.
90image_streamer(890)(00012): INFO at 0000000667.026017s: y2019/vision/image_streamer.cc: 322: main: In main.
91Before setting up udp socket 5001
92image_streamer(890)(00013): INFO at 0000000667.026090s: y2019/vision/image_streamer.cc: 324: main: In main.
93image_streamer(890)(00014): INFO at 0000000667.026142s: y2019/vision/image_streamer.cc: 328: main: In main.
94image_streamer(890)(00015): WARNING at 0000000667.026220s: aos/vision/image/reader.cc: 217: Init: xioctl VIDIOC_S_CROP due to 25 (Inappropriate ioctl for device)
95image_streamer(890)(00016): DEBUG at 0000000667.026646s: aos/vision/image/reader.cc: 162: SetCameraControl: Camera control V4L2_CID_EXPOSURE_AUTO was already 1
96image_streamer(890)(00017): DEBUG at 0000000667.027819s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_EXPOSURE_ABSOLUTE from 300 to 600
97image_streamer(890)(00018): DEBUG at 0000000667.027887s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_BRIGHTNESS from -3 to -40
98image_streamer(890)(00019): DEBUG at 0000000667.027956s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_GAIN from 16 to 0
99image_streamer(890)(00020): INFO at 0000000667.029905s: aos/vision/image/reader.cc: 277: Init: framerate ended up at 1/30
100image_streamer(890)(00021): INFO at 0000000667.031824s: aos/vision/image/reader.cc: 59: Reader: Bat Vision Successfully Initialized.
101image_streamer(890)(00022): DEBUG at 0000000667.033340s: aos/vision/image/reader.cc: 292: Start: queueing buffers for the first time
102image_streamer(890)(00023): DEBUG at 0000000667.033369s: aos/vision/image/reader.cc: 301: Start: done with first queue
103Logging to file (./logging/blob_record_38.dat)
104Running Camera
105image_streamer(890)(00024): DEBUG at 0000000667.236660s: aos/vision/image/reader.cc: 162: SetCameraControl: Camera control V4L2_CID_EXPOSURE_AUTO was already 1
106image_streamer(890)(00025): DEBUG at 0000000667.238058s: aos/vision/image/reader.cc: 175: SetCameraControl: Set camera control V4L2_CID_EXPOSURE_ABSOLUTE from 15 to 600
107image_streamer(890)(00026): INFO at 0000000667.238178s: y2019/vision/image_streamer.cc: 278: ProcessImage: Data has length 29161
108image_streamer(890)(00027): INFO at 0000000667.238205s: y2019/vision/image_streamer.cc: 335: operator(): Got a frame cam0
109image_streamer(890)(00028): INFO at 0000000667.252786s: y2019/vision/image_streamer.cc: 278: ProcessImage: Data has length 29521
110image_streamer(890)(00029): INFO at 0000000667.252809s: y2019/vision/image_streamer.cc: 335: operator(): Got a frame cam0
111image_streamer(890)(00030): INFO at 0000000667.272826s: y2019/vision/image_streamer.cc: 278: ProcessImage: Data has length 29559
112image_streamer(890)(00031): INFO at 0000000667.272848s: y2019/vision/image_streamer.cc: 335: operator(): Got a frame cam0
113image_streamer(890)(00032): INFO at 0000000667.316659s: y2019/vision/image_streamer.cc: 278: ProcessImage: Data has length 29640
114image_streamer(890)(00033): INFO at 0000000667.316680s: y2019/vision/image_streamer.cc: 335: operator(): Got a frame cam0
115image_streamer(890)(00034): INFO at 0000000667.377320s: y2019/vision/image_streamer.cc: 278: ProcessImage: Data has length 65435
116image_streamer(890)(00035): INFO at 0000000667.377346s: y2019/vision/image_streamer.cc: 335: operator(): Got a frame cam0
117image_streamer(890)(00036): INFO at 0000000667.412857s: y2019/vision/image_streamer.cc: 278: ProcessImage: Data has length 65651
118image_streamer(890)(00037): INFO at 0000000667.412945s: y2019/vision/image_streamer.cc: 335: operator(): Got a frame cam0
119image_streamer(890)(00038): INFO at 0000000667.444955s: y2019/vision/image_streamer.cc: 278: ProcessImage: Data has length 65648
120