Openag UI Camera Fix?


#1

Hi @spaghet! I saw in a screenshot you posted that you’ve got the camera working on the openag_ui. Can you share how you did that? I’d like the camera to work on mine as well. Even if it’s a hack.

Thanks!


#2

Oh hey,

so there’s a couple ways…


This simple script from Gordon works, sometimes. fswebcam is weird.

https://github.com/OpenAgInitiative/openag_brain/pull/179

This also installs pretty cleanly for me and works basically the same way.


V2 Food Computer Kit Build
#3

I remember! haha! Thank you @spaghet! I appreciate the simpleness of Gordon’s approach but prefer it compiled into ROS as you did. I’ll give that a try.

What is the URL of the image after I bring these changes in and recompile? I read your notes and saw this

This publishes an image to topic /environments/environment_1/aerial_view/image_raw of message type sensor_msgs/Image

I’ll change that in openag_ui on my install and as a PR too if it makes sense.


#4

Hey @spaghet! I pulled and built the PR you posted above as @gordonb merged it into master. Beforehand I installed OpenCV on my PI to prevent the compile error and I didn’t get an error compiling. I am getting an interesting error when I start openag_brain. See here:

pi@tangerine:~ $ rosrun openag_brain main --screen personal_food_computer_v1.launch
Initializing the database
Applying CouchDB configuration  [####################################]  100%
Creating databases  [####################################]  100%
Pushing design documents
Spawning software modules
... logging to /home/pi/.ros/log/fd0aeac6-3f2d-11e7-95fa-b827eb13f57f/roslaunch-tangerine-1787.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://tangerine:43921/

SUMMARY
========

PARAMETERS
 * /arduino_handler/serial_port: /dev/ttyACM0

...

[ INFO] [1495485245.948337182]: using default calibration URL
[ INFO] [1495485245.949062435]: camera calibration URL: file:///home/pi/.ros/camera_info/head_camera.yaml
[ INFO] [1495485245.949658419]: Unable to open camera calibration file [/home/pi/.ros/camera_info/head_camera.yaml]
[ WARN] [1495485245.949888573]: Camera calibration file /home/pi/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1495485245.950133883]: Starting 'head_camera' (/dev/video0) at 1280x1024 via mmap (mjpeg) at 1 FPS
[INFO] [WallTime: 1495485246.255640] Starting to read from Arduino
[INFO] [WallTime: 1495485247.161618] Connecting topic /environments/environment_1/air_humidity/commanded to topic /actuators/humidifier_1/cmd
[INFO] [WallTime: 1495485247.244273] Connecting topic /environments/environment_1/air_temperature/commanded to topic /actuators/heater_core_1_1/cmd
[INFO] [WallTime: 1495485247.326141] Connecting topic /environments/environment_1/cmd/commanded to topic /actuators/water_circulation_pump_1/cmd
[INFO] [WallTime: 1495485247.440634] Connecting topic /sensors/gc0012_1/air_carbon_dioxide/raw to topic /environments/environment_1/air_carbon_dioxide/raw
[ WARN] [1495485247.532480724]: unknown control 'focus_auto'

[ WARN] [1495485247.583124690]: unknown control 'focus_absolute'

[INFO] [WallTime: 1495485247.585163] Connecting topic /sensors/gc0012_1/air_carbon_dioxide/info to topic /environments/environment_1/air_carbon_dioxide/info
[INFO] [WallTime: 1495485247.681626] Connecting topic /sensors/dht22_1/air_humidity/raw to topic /environments/environment_1/air_humidity/raw
[INFO] [WallTime: 1495485247.701526] API now listening on http://0.0.0.0:5000
[INFO] [WallTime: 1495485247.774696] Connecting topic /sensors/dht22_1/air_humidity/info to topic /environments/environment_1/air_humidity/info
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485247.798393968]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[INFO] [WallTime: 1495485247.832486] Connecting topic /sensors/dht22_1/air_temperature/raw to topic /environments/environment_1/air_temperature/raw
[INFO] [WallTime: 1495485247.923565] Posting image
[ INFO] [1495485247.926965062]: Saved image /var/www/html/img.jpg
[ INFO] [1495485247.955082955]: Saved image /var/www/html/img.jpg
[INFO] [WallTime: 1495485247.955394] Connecting topic /sensors/dht22_1/air_temperature/info to topic /environments/environment_1/air_temperature/info
[ERROR] [1495485247.973486310]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[INFO] [WallTime: 1495485248.005938] Connecting topic /environments/environment_1/air_flush_on/commanded to topic /actuators/air_flush_1/cmd
[INFO] [WallTime: 1495485248.039864] Connecting topic /environments/environment_1/cmd/commanded to topic /actuators/chamber_fan_1/cmd
[INFO] [WallTime: 1495485248.057288] Connecting topic /environments/environment_1/light_intensity/commanded to topic /actuators/grow_lights_1/cmd
[INFO] [WallTime: 1495485248.178492] ROS Serial Python Node
[INFO] [WallTime: 1495485248.209625] Connecting to /dev/ttyACM0 at 57600 baud
[mjpeg @ 0xac1320] error count: 66
[mjpeg @ 0xac1320] error y=57 x=71
[ERROR] [1495485248.605128351]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485248.670178786]: Saved image /var/www/html/img.jpg
[ERROR] [1495485248.672351733]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[INFO] [WallTime: 1495485249.149471] Starting recipe "pfc1-potted-tomatoes-72days"
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485249.623237052]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485249.686148029]: Saved image /var/www/html/img.jpg
[ERROR] [1495485249.688314309]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485250.623299164]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485250.690193851]: Saved image /var/www/html/img.jpg
[ERROR] [1495485250.691884303]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[INFO] [WallTime: 1495485251.395914] Note: publish buffer size is 512 bytes
[INFO] [WallTime: 1495485251.397544] Setup publisher on /internal_diagnostics [openag_brain/DiagnosticArray]
[INFO] [WallTime: 1495485251.411862] Setup publisher on /sensors/gc0012_1/air_carbon_dioxide/raw [std_msgs/Float32]
[INFO] [WallTime: 1495485251.420971] Setup publisher on /sensors/dht22_1/air_humidity/raw [std_msgs/Float32]
[INFO] [WallTime: 1495485251.430168] Setup publisher on /sensors/dht22_1/air_temperature/raw [std_msgs/Float32]
[INFO] [WallTime: 1495485251.445444] Note: subscribe buffer size is 512 bytes
[INFO] [WallTime: 1495485251.449131] Setup subscriber on /actuators/humidifier_1/cmd [std_msgs/Bool]
[INFO] [WallTime: 1495485251.473532] Setup subscriber on /actuators/heater_core_1_1/cmd [std_msgs/Bool]
[INFO] [WallTime: 1495485251.500095] Setup subscriber on /actuators/water_circulation_pump_1/cmd [std_msgs/Bool]
[INFO] [WallTime: 1495485251.540753] Setup subscriber on /actuators/air_flush_1/cmd [std_msgs/Float32]
[INFO] [WallTime: 1495485251.558662] Setup subscriber on /actuators/chamber_fan_1/cmd [std_msgs/Bool]
[INFO] [WallTime: 1495485251.579988] Setup subscriber on /actuators/grow_lights_1/cmd [std_msgs/Bool]
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485251.636676246]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485251.692969478]: Saved image /var/www/html/img.jpg
[ERROR] [1495485251.695085863]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485252.625375765]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485252.684125066]: Saved image /var/www/html/img.jpg
[ERROR] [1495485252.685393699]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485253.628078528]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485253.688306147]: Saved image /var/www/html/img.jpg
[ERROR] [1495485253.689735925]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485254.630837749]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485254.689075648]: Saved image /var/www/html/img.jpg
[ERROR] [1495485254.690460062]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[ERROR] [1495485255.632789373]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485255.691355551]: Saved image /var/www/html/img.jpg
[ERROR] [1495485255.692916212]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[ERROR] [1495485256.632370970]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485256.692933169]: Saved image /var/www/html/img.jpg
[ERROR] [1495485256.694787421]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485257.616061738]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485257.672970276]: Saved image /var/www/html/img.jpg
[ERROR] [1495485257.675490407]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485258.616362233]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485258.671061940]: Saved image /var/www/html/img.jpg
[ERROR] [1495485258.673498842]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485259.617131578]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485259.676111866]: Saved image /var/www/html/img.jpg
[ERROR] [1495485259.677910390]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485260.657434012]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485260.735719001]: Saved image /var/www/html/img.jpg
[ERROR] [1495485260.737489347]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 65
[mjpeg @ 0xac1320] error y=56 x=51
[ERROR] [1495485261.603373912]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485261.663420908]: Saved image /var/www/html/img.jpg
[ERROR] [1495485261.665202765]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 66
[mjpeg @ 0xac1320] error y=90 x=19
[ERROR] [1495485262.616329488]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485262.671560387]: Saved image /var/www/html/img.jpg
[ERROR] [1495485262.673996716]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485263.627494040]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485263.682285933]: Saved image /var/www/html/img.jpg
[ERROR] [1495485263.683906229]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 65
[mjpeg @ 0xac1320] error y=55 x=76
[ERROR] [1495485264.606534282]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485264.668012722]: Saved image /var/www/html/img.jpg
[ERROR] [1495485264.669367917]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 69
[mjpeg @ 0xac1320] error y=33 x=79
[ERROR] [1495485265.616876707]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485265.717808810]: Saved image /var/www/html/img.jpg
[ERROR] [1495485265.719264264]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 65
[mjpeg @ 0xac1320] error y=19 x=1
[ERROR] [1495485266.596281320]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485266.654779113]: Saved image /var/www/html/img.jpg
[ERROR] [1495485266.656324150]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485267.636219800]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485267.695732322]: Saved image /var/www/html/img.jpg
[ERROR] [1495485267.696958716]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 65
[mjpeg @ 0xac1320] error y=4 x=0
[ERROR] [1495485268.591301483]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485268.651662903]: Saved image /var/www/html/img.jpg
[ERROR] [1495485268.652958254]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 68
[mjpeg @ 0xac1320] error y=14 x=79
[ERROR] [1495485269.595104911]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485269.654980190]: Saved image /var/www/html/img.jpg
[ERROR] [1495485269.656413665]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485270.688580609]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485270.756783564]: Saved image /var/www/html/img.jpg
[ERROR] [1495485270.758563286]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485271.635146909]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485271.693551266]: Saved image /var/www/html/img.jpg
[ERROR] [1495485271.695974731]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] mjpeg_decode_dc: bad vlc: 0:0 (0xac18e8)
[mjpeg @ 0xac1320] error dc
[mjpeg @ 0xac1320] error y=6 x=5
[ERROR] [1495485272.591237279]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485272.649245702]: Saved image /var/www/html/img.jpg
[ERROR] [1495485272.650888446]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485273.635265457]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485273.692657011]: Saved image /var/www/html/img.jpg
[ERROR] [1495485273.694134653]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485274.638958418]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485274.698159954]: Saved image /var/www/html/img.jpg
[ERROR] [1495485274.699351140]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485275.687900400]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485275.753691921]: Saved image /var/www/html/img.jpg
[ERROR] [1495485275.755220135]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485276.634800343]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485276.685402695]: Saved image /var/www/html/img.jpg
[ERROR] [1495485276.687122782]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485277.634847924]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485277.688435923]: Saved image /var/www/html/img.jpg
[ERROR] [1495485277.690048094]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] overread 8
[ERROR] [1495485278.634665820]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485278.693496110]: Saved image /var/www/html/img.jpg
[ERROR] [1495485278.694802607]: Unable to open camera calibration file [/var/www/html/img.ini] for writing
[mjpeg @ 0xac1320] error count: 64
[mjpeg @ 0xac1320] error y=70 x=73
[ERROR] [1495485279.615344692]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485279.676100691]: Saved image /var/www/html/img.jpg
[ERROR] [1495485279.681026578]: Unable to open camera calibration file [/var/www/html/img.ini] for writing

For giggles I chmoded 777 the img* files in the folder (img.ini and img.jpg) and now I get this:

pi@tangerine:~ $ rosrun openag_brain main --screen personal_food_computer_v1.launch

...

[ INFO] [1495485557.649679913]: using default calibration URL
[ INFO] [1495485557.651124950]: camera calibration URL: file:///home/pi/.ros/camera_info/head_camera.yaml
[ INFO] [1495485557.652123378]: Unable to open camera calibration file [/home/pi/.ros/camera_info/head_camera.yaml]
[ WARN] [1495485557.652879568]: Camera calibration file /home/pi/.ros/camera_info/head_camera.yaml not found.
[ INFO] [1495485557.653755288]: Starting 'head_camera' (/dev/video0) at 1280x1024 via mmap (mjpeg) at 1 FPS

...

[ WARN] [1495485559.317175996]: unknown control 'focus_auto'

...

[ WARN] [1495485559.375040097]: unknown control 'focus_absolute'

...

[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485559.528681354]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440

...

[INFO] [WallTime: 1495485559.681383] Posting image

...

[ INFO] [1495485559.983187897]: Saved image /var/www/html/img.jpg
[ INFO] [1495485560.073703803]: Saved image /var/www/html/img.jpg
[ERROR] [1495485560.077182727]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[INFO] [WallTime: 1495485560.302033] ROS Serial Python Node
[INFO] [WallTime: 1495485560.331196] Connecting to /dev/ttyACM0 at 57600 baud
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485560.417622925]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485560.560982046]: Saved image /var/www/html/img.jpg
[ERROR] [1495485560.562809475]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[INFO] [WallTime: 1495485561.216696] Starting recipe "pfc1-potted-tomatoes-72days"
[mjpeg @ 0x10d7640] error count: 64
[mjpeg @ 0x10d7640] error y=41 x=58
[ERROR] [1495485561.394553917]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485561.555294373]: Saved image /var/www/html/img.jpg
[ERROR] [1495485561.556997637]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485562.415235717]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485562.576630853]: Saved image /var/www/html/img.jpg
[ERROR] [1495485562.578085214]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[INFO] [WallTime: 1495485563.371079] Note: publish buffer size is 512 bytes
[INFO] [WallTime: 1495485563.372782] Setup publisher on /internal_diagnostics [openag_brain/DiagnosticArray]
[mjpeg @ 0x10d7640] error count: 65
[mjpeg @ 0x10d7640] error y=25 x=36
[ERROR] [1495485563.388908982]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[INFO] [WallTime: 1495485563.390616] Setup publisher on /sensors/gc0012_1/air_carbon_dioxide/raw [std_msgs/Float32]
[INFO] [WallTime: 1495485563.415114] Setup publisher on /sensors/dht22_1/air_humidity/raw [std_msgs/Float32]
[INFO] [WallTime: 1495485563.433866] Setup publisher on /sensors/dht22_1/air_temperature/raw [std_msgs/Float32]
[INFO] [WallTime: 1495485563.467397] Note: subscribe buffer size is 512 bytes
[INFO] [WallTime: 1495485563.469486] Setup subscriber on /actuators/humidifier_1/cmd [std_msgs/Bool]
[INFO] [WallTime: 1495485563.509298] Setup subscriber on /actuators/heater_core_1_1/cmd [std_msgs/Bool]
[INFO] [WallTime: 1495485563.539740] Setup subscriber on /actuators/water_circulation_pump_1/cmd [std_msgs/Bool]
[ INFO] [1495485563.545895517]: Saved image /var/www/html/img.jpg
[ERROR] [1495485563.547516074]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[INFO] [WallTime: 1495485563.557007] Setup subscriber on /actuators/air_flush_1/cmd [std_msgs/Float32]
[INFO] [WallTime: 1495485563.580103] Setup subscriber on /actuators/chamber_fan_1/cmd [std_msgs/Bool]
[INFO] [WallTime: 1495485563.597460] Setup subscriber on /actuators/grow_lights_1/cmd [std_msgs/Bool]
[mjpeg @ 0x10d7640] error count: 64
[mjpeg @ 0x10d7640] error y=53 x=49
[ERROR] [1495485564.395994305]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485564.524629877]: Saved image /var/www/html/img.jpg
[ERROR] [1495485564.526466733]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485565.418758635]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485565.549151429]: Saved image /var/www/html/img.jpg
[ERROR] [1495485565.550757246]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485566.425668022]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485566.565030621]: Saved image /var/www/html/img.jpg
[ERROR] [1495485566.566468003]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485567.422956725]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485567.558940504]: Saved image /var/www/html/img.jpg
[ERROR] [1495485567.560626477]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[ERROR] [1495485568.473977176]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485568.600806881]: Saved image /var/www/html/img.jpg
[ERROR] [1495485568.602331501]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485569.413497714]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485569.541629854]: Saved image /var/www/html/img.jpg
[ERROR] [1495485569.543098693]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485570.415356579]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485570.542671696]: Saved image /var/www/html/img.jpg
[ERROR] [1495485570.544200795]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485571.418675585]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485571.556905384]: Saved image /var/www/html/img.jpg
[ERROR] [1495485571.558833333]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] overread 8
[ERROR] [1495485572.420581429]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485572.548049409]: Saved image /var/www/html/img.jpg
[ERROR] [1495485572.549600123]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] error count: 70
[mjpeg @ 0x10d7640] error y=17 x=57
[ERROR] [1495485573.397338934]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485573.556817319]: Saved image /var/www/html/img.jpg
[ERROR] [1495485573.558120170]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] error count: 65
[mjpeg @ 0x10d7640] error y=24 x=0
[ERROR] [1495485574.389937320]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440
[ INFO] [1495485574.523606175]: Saved image /var/www/html/img.jpg
[ERROR] [1495485574.525359126]: Videre INI format can only save calibrations using the plumb bob distortion model. Use the YAML format instead.
	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5
[mjpeg @ 0x10d7640] mjpeg_decode_dc: bad vlc: 0:0 (0x10d7c08)
[mjpeg @ 0x10d7640] error dc
[mjpeg @ 0x10d7640] error y=46 x=71
[ERROR] [1495485575.398907415]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440

What do you think is going on?


#5

I asked @Eddie about this and he mentioned it doesn’t really matter for us since we aren’t doing any exciting CV things with the image under image_saver.

Also, whatever changes I made should save the image to /var/www/html/img.jpg which means it’s served over nginx/webserver of choice.
This was because I didn’t want to go in and change openag_ui code.

We could change it to somewhere else and serve over api, or figure out a way to create a viewable image from the image_raw topic_stream. However, I mainly made this camera image fix as more of a hack which works better than the existing hack.
Ideally, we can either write frontend code to view the image from whatever format sensor_msgs/Image is in, or use some other node to serve the images as mjpg or something.


USB Camera error (exit code -6)
#6

I was able to resolve the

by chmod-ing the ini file to 777 which is sloppy but get’s the job done.

I was able to resolve the

	distortion_model = '', expected 'plumb_bob'
	D.size() = 0, expected 5

by creating a fake calibration file for the camera using this http://wiki.ros.org/camera_calibration_parsers

I have not been able to resolve the

and the image file I’m getting looks like this:

Here’s what I get when I hook the camera to my laptop:

This is the camera I’m using: https://www.amazon.com/gp/product/B00YCDHQ8K?psc=1&redirect=true&ref_=oh_aui_detailpage_o06_s00

I suspect this is a calibration issue and if I had a calibration file it would work. Here’s more on calibration: http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration

Thanks for your help!

J


#7

Ahh. Got it. Well I am working on getting it to save a proper image. Once I get that, I’ll spin up some kind of image service.

Thanks!

J


#8

That error message looks like maybe your camera resolution is too low for what we’re requesting?

I’m not sure, but the cameras we use are http://a.co/fP0B0xM These 5MP cameras.


#9

The UI refetches the img.jpg file every ~26 sec. so you just need to have the latest available image there for it to “work”


#10

Thanks @spaghet! I got it working. The camera I have has different resolution abilities than the camera you use.

v4l2-ctl --list-formats-ext

With that I got a list of the available settings and I could see that the camera was set to an unavailable resolution. By setting it to 1280x960 (PFC1 cam highest resolution) I was able to stop the outbuf error.

[ERROR] [1495485561.394553917]: outbuf size mismatch.  pic_size: 2457600 bufsize: 2621440

Then I got a new set of errors.

[ INFO] [1495501559.072702402]: Saved image /var/www/html/img.jpg
[mjpeg @ 0x6bdf00] error count: 64
[mjpeg @ 0x6bdf00] error y=32 x=29
[swscaler @ 0x7085e0] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501560.070220437]: Saved image /var/www/html/img.jpg
[mjpeg @ 0x6bdf00] error count: 70
[mjpeg @ 0x6bdf00] error y=16 x=4
[swscaler @ 0x7085e0] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501561.069067573]: Saved image /var/www/html/img.jpg
[mjpeg @ 0x6bdf00] overread 8
[swscaler @ 0x7085e0] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501562.079547941]: Saved image /var/www/html/img.jpg
[swscaler @ 0x70b4c0] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501563.081326249]: Saved image /var/www/html/img.jpg
[mjpeg @ 0x6bdf00] error count: 64
[mjpeg @ 0x6bdf00] error y=16 x=39
[swscaler @ 0x70d660] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501564.072294756]: Saved image /var/www/html/img.jpg
[swscaler @ 0x70d660] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501565.092384673]: Saved image /var/www/html/img.jpg
[mjpeg @ 0x6bdf00] error count: 70
[mjpeg @ 0x6bdf00] error y=28 x=1
[swscaler @ 0x70d660] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501566.073187176]: Saved image /var/www/html/img.jpg
[mjpeg @ 0x6bdf00] error count: 72
[mjpeg @ 0x6bdf00] error y=9 x=0
[swscaler @ 0x70d660] No accelerated colorspace conversion found from yuv422p to rgb24.
[ INFO] [1495501567.068338979]: Saved image /var/www/html/img.jpg
[mjpeg @ 0x6bdf00] error count: 65
[mjpeg @ 0x6bdf00] error y=8 x=0
[swscaler @ 0x70d660] No accelerated colorspace conversion found from yuv422p to rgb24.

The output looked like this:

This I resolved by setting the camera to YUYV mode instead of MJPEG.

SO NOW IT WORKS!!!

Here’s my head_camera.yaml fake config file.

Here’s my updated usb_cam.yaml

Thanks so much for your help!

J


Sensor responded with the wrong function code:255
#11

Need to rotate the camera 90 degrees and port the bigger humidifier in from outside. :slight_smile:


Openag-ui web app build diary
#12

Haha, super cool!
Thank you for doing this, I was going to do this once I had free time after work to finish up my PFC v1 but you’ve made amazing progress on our behalf.

Is that a rice cooker and a soil based pot in the PFC v1? :wink:


#13

Hah! Yes, that’s a potted tomato. I don’t have the aquaponic sensors up yet (I still need to learn how to grow aquaponically). I’m testing a recipe to see if growth happens or I burn down the house. So far it’s been growth and openag_brain is doing a great job monitoring and maintaining the environment. That plant is twice as large as it was when I potted it. I’m interested to see if an 18/6 exposure shortens the duration to fruit. I got my first flower yesterday.

That other thing is a humidifier because the tiny one that came with the PFC1 BoM required daily filling. The big one is cool! It fills the chamber with fog. (second picture). I’m working on a design that puts it outside the chamber.

I’m working on aquaponics sensors next. Need to get those into the build and then I start an aquaponic test.

Cheers,

J


#14

Oh, you’re doing aquaponics as well?
I was making something less vanilla and stuck a bunch of v2 sensors into an aquasprouts kit once, it worked pretty well.

What do you plan to add for “aquaponic sensors”? My guess would be ammonia or something but those are really expensive and only useful while you set up the system.


V2 Food Computer Kit Build
#15

Oops. I misspoke, I’m doing DWC hydroponics. The sensors I’m talking about are EC/temp/and pH. I just found my industrial pH sensor arrived from DFRobot with a cracked bulb. If they don’t replace it I’m probably going to get the Atlas sensor array and start upgrading. I think the CO2 sensor (cozir) is flakey as all hell and it’s on my replace list too. Once I have all of the DWC sensors up and running I’ll start some seeds and see how they grow. The tomato I’m growing in a pot is doing REALLY well. It’s outpacing my IRL tomatoes. haha!

Cheers!

J


#16

Hey @juhnke.

by creating a fake calibration file for the camera using this http://wiki.ros.org/camera_calibration_parsers

How exactly did you create a fake calibration file. And where does it reside?
I tried
rosrun camera_calibration_parsers convert img.ini img.yml from inside the /var/www/html folder. However, I’ve been getting the error

[ INFO] [1496565647.032191130]: Unable to open camera calibration file [img.ini]
[ERROR] [1496565647.032440713]: Failed to load camera model from file img.ini

Could this be a permissions issue. (I did chmod 777 the img.ini file though).

Maybe it would help me if you could share what was the exact conversion command you’d run and which location from.

Thanks.


#17

The MHZ16 CO2 sensor for the v2 is pretty nice, it works pretty reliably and happens to be one of the most quick to respond and can detect a person entering the room from their CO2 emissions.

I’m doing DWC hydroponics.

bummer! thought I found an ally. One day I’ll start an aquaponics category here lol


#18

To resolve these issues for currently Windows versions or windows servers is a software named “LONG PATH TOOL”, I suggest everyone a software “Long Path Tool“ which can solve all the long path problems.


#19

I literally took an existing config file I found on the internet for a different camera and then modified it slightly for the PFC1 camera.

Get it here. It literally does NOTHING. https://github.com/novemberalpha/openag_brain_pfc1_config/blob/master/head_camera.yaml


#20

I’m having trouble getting the camera to work.

My camera’s max resolution is 1280 Horizontal by 960 Vertical. Where in the code or settings file can i specify these resolution settings. As it is when I execute rosrun to start the brain I eventually see error messages indicating an issue with the camera resolution.

Ok. I found my issue. I edited the file named /opt/ros/indigo/share/openag_brain/launch/personal_food_computer_v2.launch to specify my camera’s resolution and it fixed the error outlined above.

thanks

JOe