ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

ROS Hydro - Cannot commit gscam camera calibration (/set_camera_info not under /camera)

asked 2014-10-17 04:02:35 -0500

Athria gravatar image

updated 2014-10-17 04:06:34 -0500

gvdhoorn gravatar image

Hello, I started using ROS hydro (in ubuntu 12.04) very recently for a visual odometry project but I got stuck with the following problem:

I installed gscam and it runs fine (or at least I think so because I can get the raw image from the cam) but when I try to calibrate it using the camera_calibration package I get an error about the set_camera_info when trying to commit.

This are the commands I’m using (and the responses I’m getting):

ire@ubuntu:/opt/ros/hydro/share/gscam$ export GSCAM_CONFIG="v4l2src device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace"
ire@ubuntu:/opt/ros/hydro/share/gscam$ rosrun gscam gscam
[ INFO] [1413532922.860687013]: Using gstreamer config from env: "v4l2src device=/dev/video0 ! video/x-raw-rgb ! ffmpegcolorspace"
[ INFO] [1413532922.865519517]: using default calibration URL
[ INFO] [1413532922.865710842]: camera calibration URL: file:///home/ire/.ros/camera_info/camera.yaml
[ INFO] [1413532922.865894433]: Unable to open camera calibration file [/home/ire/.ros/camera_info/camera.yaml]
[ WARN] [1413532922.866022619]: Camera calibration file /home/ire/.ros/camera_info/camera.yaml not found.
[ INFO] [1413532922.866143973]: Loaded camera calibration from 
[ WARN] [1413532922.867056658]: No camera frame_id set, using frame "/camera_frame".
[ INFO] [1413532922.931583052]: Time offset: 1413532776.252
[ INFO] [1413532923.433639353]: Publishing stream...
[ INFO] [1413532923.440739002]: Started stream.

At this point the light on my camera turns on and if I run the rosrun image_view image_view image:=/camera/image_raw the camera works.

I checked the topics and services and this is what I got:

ire@ubuntu:~$ rostopic list
/camera/camera_info
/camera/image_raw
/camera/image_raw/compressed
/camera/image_raw/compressed/parameter_descriptions
/camera/image_raw/compressed/parameter_updates
/camera/image_raw/compressedDepth
/camera/image_raw/compressedDepth/parameter_descriptions
/camera/image_raw/compressedDepth/parameter_updates
/camera/image_raw/theora
/camera/image_raw/theora/parameter_descriptions
/camera/image_raw/theora/parameter_updates
/rosout
/rosout_agg
ire@ubuntu:~$ rosservice list
/camera/image_raw/compressed/set_parameters
/camera/image_raw/compressedDepth/set_parameters
/camera/image_raw/theora/set_parameters
/gscam_publisher/get_loggers
/gscam_publisher/set_logger_level
/rosout/get_loggers
/rosout/set_logger_level
/set_camera_info

As you can see the /set_camera_info service is not under /camera like it’s apparently supposed to be (I’m not sure if it is, that’s just the conclusion I got to). So I run the camera calibration with the following command:

ire@ubuntu:~$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 image:=/camera/image_raw camera:=

But after finishing and trying to commit I get this error:

 raise ServiceException("service [%s] unavailable"%self.resolved_name)
rospy.service.ServiceException: service [/camera/set_camera_info] unavailable

I’ve tried changing the parameters in the camera_calibration command, using camera_info:= instead of camera:= and so on, but I always get the same mistake when trying to commit. If I use camera:=camera or camera_info:=camera as parameters the calibration cannot start because the set_camera_info service is not under /camera. If I ignore the check with --no-service-check I still get the same mistake at the end.

I’m pretty new with ROS, so I’m sorry if the question is too silly. I really tried to find the answer myself but I don’t know what to do about the service not being under /camera ... (more)

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2014-10-18 19:23:31 -0500

tfoote gravatar image

You can move ros resources using remapping. Both from the command line and from a launch file

edit flag offensive delete link more
0

answered 2014-10-27 05:24:44 -0500

Athria gravatar image

Thank you very much, I managed to do the remapping from the command line and I think the calibration worked.

Thank you!

edit flag offensive delete link more

Comments

@Athria Please accept answers using the checkbox at the left instead of closing the question. Accepting the answer implicitly marks it as resolved instead of closed. I've fixed it for this question.

tfoote gravatar image tfoote  ( 2014-10-27 13:27:25 -0500 )edit

hey ,I encounter the same problem ,could you please explain how you change the command line? Thank you !

chaoqunzhuoyue gravatar image chaoqunzhuoyue  ( 2015-04-01 22:44:28 -0500 )edit
1

Hello, no problem, I also had trouble figuring how to remap it. I ran the gscam node with: rosrun gscam gscam set_camera_info:=/camera/set_camera_info and it gave me the service /camera/set_camera_info leaving the rest untouched.

Hope it helps.

Athria gravatar image Athria  ( 2015-04-02 05:15:54 -0500 )edit

Thanks ,it really helps!

chaoqunzhuoyue gravatar image chaoqunzhuoyue  ( 2015-04-02 21:03:03 -0500 )edit

Same problem solved. Thanks a lot!

janis gravatar image janis  ( 2015-07-12 12:58:55 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-10-17 04:02:35 -0500

Seen: 2,226 times

Last updated: Oct 27 '14