Ask Your Question

Error in loading whycon file

asked 2018-05-04 15:24:37 -0500

sdorman gravatar image

updated 2018-05-07 08:16:04 -0500

I’m trying to run Whycon using ROS Kinetic with a USB camera on Ubuntu 16.04 LTS. I followed the whycon tutorial to calibrate the camera. After calibration, I ran in my home directory:

sdorman@ikon:~$ ROS_NAMESPACE=usb_cam rosrun image_proc image_proc

And in a new terminal:

sdorman@ikon:~/catkin_ws$ rosrun image_view image_view image:=usb_cam/image_rect_color This worked with no issues. I then unpacked the calibration data from the tar.gz file using $tar -xvzf and then converted the ost.txt file to an ost.ini via

sdorman@ikon:~$ mv ost.txt ost.ini

And then ran:

sdorman@daikon:~$ rosrun camera_calibration_parsers convert ost.ini whycon_transforms.yml
[ INFO] [1525377222.129394510]: Saved whycon_transforms.yml

to convert to a yml file. I sourced catkin_ws and then moved up to the whycon directory to run

sdorman@ikon:~/catkin_ws/src$ rosrun whycon whycon _targets:=1

Here I get the error “could not load file”.

sdorman@ikon:~/catkin_ws$ rosrun whycon whycon _targets:=1
[ INFO] [1525461972.198655861]: Loading file whycon_transforms.yml
[ WARN] [1525461972.198760338]: Could not load "whycon_transforms.yml"

This error also occurs in any other directory than my catkin_ws/src folder. If I move back to ~/catkin_ws/src I get the following error.

sdorman@ikon:~/catkin_ws/src$ rosrun whycon whycon _targets:=1
[ INFO] [1525461901.679379776]: Loading file whycon_transforms.yml
terminate called after throwing an instance of 'YAML::TypedBadConversion<double>'
  what():  yaml-cpp: error at line 0, column 0: bad conversion
Aborted (core dumped)

I’ve tried re-downloading Whycon and repeating the entire process but that did not work. I’m not sure where I went wrong, but any help would be appreciated.

Here's the whycon_ros file:

C:\fakepath\1st part of whycon.JPG

C:\fakepath\2nd part of whcon.JPG

C:\fakepath\3rd part of whycon.JPG


image_width: 640
image_height: 480
camera_name: narrow_stereo
  rows: 3
  cols: 3
  data: [664.135327, 0, 343.103845, 0, 668.256661, 227.776189, 0, 0, 1]
distortion_model: plumb_bob
  rows: 1
  cols: 5
  data: [0.141424, -0.347581, 0.002344, 0.008555999999999999, 0]

  rows: 3
  cols: 3
  data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
  rows: 3
  cols: 4
  data: [672.257385, 0, 347.376007, 0, 0, 681.516541, 228.472198, 0, 0, 0, 1, 0]
edit retag flag offensive close merge delete


Sorry, I couldn't upload photos.

sdorman gravatar imagesdorman ( 2018-05-04 15:25:16 -0500 )edit

I've bumped your karma so you should be able to upload images now.

ahendrix gravatar imageahendrix ( 2018-05-04 20:48:35 -0500 )edit

2 Answers

Sort by » oldest newest most voted

answered 2018-05-17 17:17:41 -0500

sdorman gravatar image

So I ended up using the rviz Image display and that worked fine. I can't overlay the tracking over my image but I don't really need to. I had to run ~/catkin_ws/src/whycon/launch $ rosrun rviz rviz -d whycon.rviz for targets to be tracked and selected PoseArray as a subscribed topic.

Going back to my original problem, I also figured out the whycon_transforms.yml file. I ran ~/catkin_ws/src/whycon/src/ros $ rosrun whycon set_axis and the ~/catkin_ws/src/whycon $ rosrun whycon whycon _targets:=4 simultaneously. The set_axis node created the whycon_transforms.yml file. So please ignore the above WHYCON_TRANSFORMS.YML file that I preemptively created. The transforms file is created within the ~/catkin_ws/src/whycon/src/ros folder so I changed directories to run the ~/catkin_ws/src/whycon/src/ros $ rosrun whycon whycon _targets:=4 and my warning disappeared.

edit flag offensive delete link more

answered 2018-05-04 20:57:39 -0500

ahendrix gravatar image

It looks like your whycon_transforms.yml is created in your home directory, but when you run the whycon node you're running it from ~/catkin_ws/src so it's looking for whycon_transforms.yml in that directory.

Try running rosrun whycon whycon _targets:=1 from your home directory.

edit flag offensive delete link more


I've tried that. If I run rosrun whycon whycon _targets:=1 in my home directory, I get "could not load file." If I run it in catkin_ws/src I get the bad conversion error.

sdorman gravatar imagesdorman ( 2018-05-07 08:07:58 -0500 )edit

I found this version of whycon on github: , and it seems to be expecting a different file format.

ahendrix gravatar imageahendrix ( 2018-05-07 20:05:39 -0500 )edit

Instead of providing screen captures of the code, please provide a link to the github repo that you're using.

ahendrix gravatar imageahendrix ( 2018-05-07 20:06:06 -0500 )edit I've been using these files.

sdorman gravatar imagesdorman ( 2018-05-09 15:07:31 -0500 )edit

Yes, it seems like the whycon_transforms.yml file isn't in a format that the whycon node is expecting. I have not been able to find any documentation on the file format or how to generate it.

ahendrix gravatar imageahendrix ( 2018-05-09 15:30:58 -0500 )edit

The ticket you opened on the whycon issue tracker says that this calibration file is optional: , and that it should work without it.

ahendrix gravatar imageahendrix ( 2018-05-09 15:32:24 -0500 )edit

I've been attempting to continue onward (ignoring said error). I now can't get the whycon to actually publish whycon/camera_info so that it appears in rviz.

sdorman gravatar imagesdorman ( 2018-05-09 15:48:38 -0500 )edit

Try using the rviz Image display instead of a Camera display. The Image display does not require a camera_info.

ahendrix gravatar imageahendrix ( 2018-05-09 17:52:29 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2018-05-04 15:24:37 -0500

Seen: 456 times

Last updated: May 17 '18