ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Mon, 04 Jan 2016 10:14:55 -0600- How to remap service? commit button during camera_calibration doesn't workhttps://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/Hi,
I didn't find accurate answer to [this question](http://answers.ros.org/question/195217/ros-hydro-cannot-commit-gscam-camera-calibration-set_camera_info-not-under-camera/)
I would like to remap service from /set_camera_info to /camera/set_camera_info
according to this instructions: http://wiki.ros.org/Remapping%20Arguments
I tried:
przemek@przem:~$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.025 image:=/image_raw set_camera_info:=/camera/set_camera_info
but after pushing on commit button I get:
raise ServiceException("service [%s] unavailable"%self.resolved_name)
rospy.service.ServiceException: service [/camera/set_camera_info] unavailable
so my camera is calibrated or not?
details from calibration:
rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.025 image:=/image_raw set_camera_info:=/camera/set_camera_info
*** Added sample 1, p_x = 0.675, p_y = 0.933, p_size = 0.446, skew = 0.038
*** Added sample 2, p_x = 0.528, p_y = 0.502, p_size = 0.282, skew = 0.135
*** Added sample 3, p_x = 0.566, p_y = 0.416, p_size = 0.300, skew = 0.209
*** Added sample 4, p_x = 0.533, p_y = 0.382, p_size = 0.247, skew = 0.092
*** Added sample 5, p_x = 0.523, p_y = 0.500, p_size = 0.169, skew = 0.003
*** Added sample 6, p_x = 0.261, p_y = 0.480, p_size = 0.181, skew = 0.011
*** Added sample 7, p_x = 0.727, p_y = 0.526, p_size = 0.181, skew = 0.186
*** Added sample 8, p_x = 0.836, p_y = 0.546, p_size = 0.168, skew = 0.536
*** Added sample 9, p_x = 0.867, p_y = 0.544, p_size = 0.166, skew = 0.151
*** Added sample 10, p_x = 0.924, p_y = 0.552, p_size = 0.157, skew = 0.278
*** Added sample 11, p_x = 0.120, p_y = 0.602, p_size = 0.209, skew = 0.001
*** Added sample 12, p_x = 0.389, p_y = 0.627, p_size = 0.322, skew = 0.029
*** Added sample 13, p_x = 0.674, p_y = 0.736, p_size = 0.284, skew = 0.440
*** Added sample 14, p_x = 0.772, p_y = 0.559, p_size = 0.298, skew = 0.498
*** Added sample 15, p_x = 0.808, p_y = 0.515, p_size = 0.287, skew = 0.622
*** Added sample 16, p_x = 0.802, p_y = 0.528, p_size = 0.250, skew = 0.815
*** Added sample 17, p_x = 0.749, p_y = 0.613, p_size = 0.331, skew = 0.010
*** Added sample 18, p_x = 0.633, p_y = 0.599, p_size = 0.323, skew = 0.120
*** Added sample 19, p_x = 0.370, p_y = 0.594, p_size = 0.287, skew = 0.325
*** Added sample 20, p_x = 0.314, p_y = 0.589, p_size = 0.262, skew = 0.630
*** Added sample 21, p_x = 0.514, p_y = 0.690, p_size = 0.279, skew = 0.224
*** Added sample 22, p_x = 0.554, p_y = 0.643, p_size = 0.362, skew = 0.267
*** Added sample 23, p_x = 0.608, p_y = 0.618, p_size = 0.401, skew = 0.373
*** Added sample 24, p_x = 0.671, p_y = 0.585, p_size = 0.440, skew = 0.443
*** Added sample 25, p_x = 0.604, p_y = 0.604, p_size = 0.415, skew = 0.546
*** Added sample 26, p_x = 0.603, p_y = 0.520, p_size = 0.452, skew = 0.094
*** Added sample 27, p_x = 0.670, p_y = 0.441, p_size = 0.512, skew = 0.103
*** Added sample 28, p_x = 0.739, p_y = 0.481, p_size = 0.595, skew = 0.096
*** Added sample 29, p_x = 0.613, p_y = 0.531, p_size = 0.608, skew = 0.062
*** Added sample 30, p_x = 0.472, p_y = 0.590, p_size = 0.613, skew = 0.017
*** Added sample 31, p_x = 0.286, p_y = 0.651, p_size = 0.615, skew = 0.017
*** Added sample 32, p_x = 0.462, p_y = 0.454, p_size = 0.538, skew = 0.040
*** Added sample 33, p_x = 0.495, p_y = 0.483, p_size = 0.403, skew = 0.057
*** Added sample 34, p_x = 0.372, p_y = 0.508, p_size = 0.225, skew = 0.036
*** Added sample 35, p_x = 0.183, p_y = 0.499, p_size = 0.231, skew = 0.120
*** Added sample 36, p_x = 0.642, p_y = 0.453, p_size = 0.249, skew = 0.152
*** Added sample 37, p_x = 0.766, p_y = 0.457, p_size = 0.246, skew = 0.236
*** Added sample 38, p_x = 0.787, p_y = 0.678, p_size = 0.257, skew = 0.099
*** Added sample 39, p_x = 0.691, p_y = 0.786, p_size = 0.282, skew = 0.024
*** Added sample 40, p_x = 0.821, p_y = 0.835, p_size = 0.291, skew = 0.055
*** Added sample 41, p_x = 0.267, p_y = 0.825, p_size = 0.277, skew = 0.047
*** Added sample 42, p_x = 0.366, p_y = 0.355, p_size = 0.269, skew = 0.040
*** Added sample 43, p_x = 0.339, p_y = 0.171, p_size = 0.261, skew = 0.038
*** Added sample 44, p_x = 0.203, p_y = 0.165, p_size = 0.262, skew = 0.095
*** Added sample 45, p_x = 0.095, p_y = 0.081, p_size = 0.265, skew = 0.084
*** Added sample 46, p_x = 0.746, p_y = 0.246, p_size = 0.260, skew = 0.048
*** Added sample 47, p_x = 0.557, p_y = 0.255, p_size = 0.336, skew = 0.030
*** Added sample 48, p_x = 0.586, p_y = 0.416, p_size = 0.378, skew = 0.017
*** Added sample 49, p_x = 0.546, p_y = 0.570, p_size = 0.368, skew = 0.012
*** Added sample 50, p_x = 0.487, p_y = 0.647, p_size = 0.422, skew = 0.024
*** Added sample 51, p_x = 0.468, p_y = 0.335, p_size = 0.364, skew = 0.042
('D = ', [0.16766375017299506, -0.4743189223230769, -0.0018360893414158595, -0.007967057319851693, 0.0])
('K = ', [638.3829271681988, 0.0, 325.2086857461768, 0.0, 638.7458289003911, 253.99479848293905, 0.0, 0.0, 1.0])
('R = ', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0])
('P = ', [645.5219307177209, 0.0, 321.01413093677576, 0.0, 0.0, 649.3208039462043, 252.99538074326645, 0.0, 0.0, 0.0, 1.0, 0.0])
None
# oST version 5.0 parameters
[image]
width
640
height
480
[narrow_stereo]
camera matrix
638.382927 0.000000 325.208686
0.000000 638.745829 253.994798
0.000000 0.000000 1.000000
distortion
0.167664 -0.474319 -0.001836 -0.007967 0.000000
rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
projection
645.521931 0.000000 321.014131 0.000000
0.000000 649.320804 252.995381 0.000000
0.000000 0.000000 1.000000 0.000000
('Wrote calibration data to', '/tmp/calibrationdata.tar.gz')
('D = ', [0.16766375017299506, -0.4743189223230769, -0.0018360893414158595, -0.007967057319851693, 0.0])
('K = ', [638.3829271681988, 0.0, 325.2086857461768, 0.0, 638.7458289003911, 253.99479848293905, 0.0, 0.0, 1.0])
('R = ', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0])
('P = ', [645.5219307177209, 0.0, 321.01413093677576, 0.0, 0.0, 649.3208039462043, 252.99538074326645, 0.0, 0.0, 0.0, 1.0, 0.0])
# oST version 5.0 parameters
[image]
width
640
height
480
[narrow_stereo]
camera matrix
638.382927 0.000000 325.208686
0.000000 638.745829 253.994798
0.000000 0.000000 1.000000
distortion
0.167664 -0.474319 -0.001836 -0.007967 0.000000
rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
projection
645.521931 0.000000 321.014131 0.000000
0.000000 649.320804 252.995381 0.000000
0.000000 0.000000 1.000000 0.000000
Traceback (most recent call last):
File "/opt/ros/indigo/lib/camera_calibration/cameracalibrator.py", line 258, in on_mouse
if self.do_upload():
File "/opt/ros/indigo/lib/camera_calibration/cameracalibrator.py", line 215, in do_upload
response = self.set_camera_info_service(info)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in __call__
return self.call(*args, **kwds)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 495, in call
service_uri = self._get_service_uri(request)
File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 463, in _get_service_uri
raise ServiceException("service [%s] unavailable"%self.resolved_name)
rospy.service.ServiceException: service [/camera/set_camera_info] unavailable
('D = ', [0.16109017149033977, -0.4643274529079085, -0.0008100982174653491, -0.00874881267984191, 0.0])
('K = ', [643.0082704162377, 0.0, 324.2012424198703, 0.0, 641.971634246, 248.40417885145268, 0.0, 0.0, 1.0])
('R = ', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0])
('P = ', [649.589721002749, 0.0, 319.62111166997533, 0.0, 0.0, 652.2217572318475, 247.692533771725, 0.0, 0.0, 0.0, 1.0, 0.0])
None
# oST version 5.0 parameters
[image]
width
640
height
480
[narrow_stereo]
camera matrix
643.008270 0.000000 324.201242
0.000000 641.971634 248.404179
0.000000 0.000000 1.000000
distortion
0.161090 -0.464327 -0.000810 -0.008749 0.000000
rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000
projection
649.589721 0.000000 319.621112 0.000000
0.000000 652.221757 247.692534 0.000000
0.000000 0.000000 1.000000 0.000000
Tue, 25 Nov 2014 14:57:34 -0600https://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/
- Comment by Dan Lazewatsky for <div class="snippet"><p>Hi,
I didn't find accurate answer to <a href="http://answers.ros.org/question/195217/ros-hydro-cannot-commit-gscam-camera-calibration-set_camera_info-not-under-camera/">this question</a></p>
<p>I would like to remap service from /set_camera_info to /camera/set_camera_info</p>
<p> according to this instructions: <a href="http://wiki.ros.org/Remapping%20Arguments">http://wiki.ros.org/Remapping%20Argum...</a>
I tried: </p>
<pre><code>przemek@przem:~$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.025 image:=/image_raw set_camera_info:=/camera/set_camera_info
</code></pre>
<p>but after pushing on commit button I get:
raise ServiceException("service [%s] unavailable"%self.resolved_name)
rospy.service.ServiceException: service [/camera/set_camera_info] unavailable</p>
<p>so my camera is calibrated or not? </p>
<p>details from calibration: </p>
<pre><code>rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.025 image:=/image_raw set_camera_info:=/camera/set_camera_info
*** Added sample 1, p_x = 0.675, p_y = 0.933, p_size = 0.446, skew = 0.038
*** Added sample 2, p_x = 0.528, p_y = 0.502, p_size = 0.282, skew = 0.135
*** Added sample 3, p_x = 0.566, p_y = 0.416, p_size = 0.300, skew = 0.209
*** Added sample 4, p_x = 0.533, p_y = 0.382, p_size = 0.247, skew = 0.092
*** Added sample 5, p_x = 0.523, p_y = 0.500, p_size = 0.169, skew = 0.003
*** Added sample 6, p_x = 0.261, p_y = 0.480, p_size = 0.181, skew = 0.011
*** Added sample 7, p_x = 0.727, p_y = 0.526, p_size = 0.181, skew = 0.186
*** Added sample 8, p_x = 0.836, p_y = 0.546, p_size = 0.168, skew = 0.536
*** Added sample 9, p_x = 0.867, p_y = 0.544, p_size = 0.166, skew = 0.151
*** Added sample 10, p_x = 0.924, p_y = 0.552, p_size = 0.157, skew = 0.278
*** Added sample 11, p_x = 0.120, p_y = 0.602, p_size = 0.209, skew = 0.001
*** Added sample 12, p_x = 0.389, p_y = 0.627, p_size = 0.322, skew = 0.029
*** Added sample 13, p_x = 0.674, p_y = 0.736, p_size = 0.284, skew = 0.440
*** Added sample 14, p_x = 0.772, p_y = 0.559, p_size = 0.298, skew = 0.498
*** Added sample 15, p_x = 0.808, p_y = 0.515, p_size = 0.287, skew = 0.622
*** Added sample 16, p_x = 0.802, p_y = 0.528, p_size = 0.250, skew = 0.815
*** Added sample 17, p_x = 0.749, p_y = 0.613, p_size = 0.331, skew = 0.010
*** Added sample 18, p_x = 0.633, p_y = 0.599, p_size = 0.323, skew = 0.120
*** Added sample 19, p_x = 0.370, p_y = 0.594, p_size = 0.287, skew = 0.325
*** Added sample 20, p_x = 0.314, p_y = 0.589, p_size = 0.262, skew = 0.630
*** Added sample 21, p_x = 0.514, p_y = 0.690, p_size = 0.279, skew = 0.224
*** Added sample 22, p_x = 0.554, p_y = 0.643, p_size = 0.362, skew = 0.267
*** Added sample 23, p_x = 0.608, p_y = 0.618, p_size = 0.401, skew = 0.373
*** Added sample 24, p_x = 0.671, p_y = 0.585, p_size = 0.440, skew = 0.443
*** Added sample 25, p_x = 0.604, p_y = 0.604, p_size = 0.415, skew = 0.546
*** Added sample 26, p_x = 0.603, p_y = 0.520, p_size = 0.452, skew = 0.094
*** Added sample 27, p_x = 0.670, p_y = 0.441, p_size = 0.512, skew = 0.103 ...</code></pre><span class="expander"> <a>(more)</a></span></div>https://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/?comment=198302#post-id-198302Are you sure that's what your camera's set_camera_info service is called? What do you see when you run `rosservice list`?Tue, 25 Nov 2014 16:16:53 -0600https://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/?comment=198302#post-id-198302
- Answer by green96 for <div class="snippet"><p>Hi,
I didn't find accurate answer to <a href="http://answers.ros.org/question/195217/ros-hydro-cannot-commit-gscam-camera-calibration-set_camera_info-not-under-camera/">this question</a></p>
<p>I would like to remap service from /set_camera_info to /camera/set_camera_info</p>
<p> according to this instructions: <a href="http://wiki.ros.org/Remapping%20Arguments">http://wiki.ros.org/Remapping%20Argum...</a>
I tried: </p>
<pre><code>przemek@przem:~$ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.025 image:=/image_raw set_camera_info:=/camera/set_camera_info
</code></pre>
<p>but after pushing on commit button I get:
raise ServiceException("service [%s] unavailable"%self.resolved_name)
rospy.service.ServiceException: service [/camera/set_camera_info] unavailable</p>
<p>so my camera is calibrated or not? </p>
<p>details from calibration: </p>
<pre><code>rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.025 image:=/image_raw set_camera_info:=/camera/set_camera_info
*** Added sample 1, p_x = 0.675, p_y = 0.933, p_size = 0.446, skew = 0.038
*** Added sample 2, p_x = 0.528, p_y = 0.502, p_size = 0.282, skew = 0.135
*** Added sample 3, p_x = 0.566, p_y = 0.416, p_size = 0.300, skew = 0.209
*** Added sample 4, p_x = 0.533, p_y = 0.382, p_size = 0.247, skew = 0.092
*** Added sample 5, p_x = 0.523, p_y = 0.500, p_size = 0.169, skew = 0.003
*** Added sample 6, p_x = 0.261, p_y = 0.480, p_size = 0.181, skew = 0.011
*** Added sample 7, p_x = 0.727, p_y = 0.526, p_size = 0.181, skew = 0.186
*** Added sample 8, p_x = 0.836, p_y = 0.546, p_size = 0.168, skew = 0.536
*** Added sample 9, p_x = 0.867, p_y = 0.544, p_size = 0.166, skew = 0.151
*** Added sample 10, p_x = 0.924, p_y = 0.552, p_size = 0.157, skew = 0.278
*** Added sample 11, p_x = 0.120, p_y = 0.602, p_size = 0.209, skew = 0.001
*** Added sample 12, p_x = 0.389, p_y = 0.627, p_size = 0.322, skew = 0.029
*** Added sample 13, p_x = 0.674, p_y = 0.736, p_size = 0.284, skew = 0.440
*** Added sample 14, p_x = 0.772, p_y = 0.559, p_size = 0.298, skew = 0.498
*** Added sample 15, p_x = 0.808, p_y = 0.515, p_size = 0.287, skew = 0.622
*** Added sample 16, p_x = 0.802, p_y = 0.528, p_size = 0.250, skew = 0.815
*** Added sample 17, p_x = 0.749, p_y = 0.613, p_size = 0.331, skew = 0.010
*** Added sample 18, p_x = 0.633, p_y = 0.599, p_size = 0.323, skew = 0.120
*** Added sample 19, p_x = 0.370, p_y = 0.594, p_size = 0.287, skew = 0.325
*** Added sample 20, p_x = 0.314, p_y = 0.589, p_size = 0.262, skew = 0.630
*** Added sample 21, p_x = 0.514, p_y = 0.690, p_size = 0.279, skew = 0.224
*** Added sample 22, p_x = 0.554, p_y = 0.643, p_size = 0.362, skew = 0.267
*** Added sample 23, p_x = 0.608, p_y = 0.618, p_size = 0.401, skew = 0.373
*** Added sample 24, p_x = 0.671, p_y = 0.585, p_size = 0.440, skew = 0.443
*** Added sample 25, p_x = 0.604, p_y = 0.604, p_size = 0.415, skew = 0.546
*** Added sample 26, p_x = 0.603, p_y = 0.520, p_size = 0.452, skew = 0.094
*** Added sample 27, p_x = 0.670, p_y = 0.441, p_size = 0.512, skew = 0.103 ...</code></pre><span class="expander"> <a>(more)</a></span></div> https://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/?answer=198304#post-id-198304I made a mistake, I should remap this service when I run uvc_cam node. After this change, commit works!
solution:
**rosrun uvc_camer uvc_camera_node set_camera_info:=/camera/set_camera_info**
after it start calibration.Tue, 25 Nov 2014 16:31:48 -0600https://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/?answer=198304#post-id-198304
- Comment by Farid for <p>I made a mistake, I should remap this service when I run uvc_cam node. After this change, commit works!
solution: </p>
<p><strong>rosrun uvc_camer uvc_camera_node set_camera_info:=/camera/set_camera_info</strong>
after it start calibration.</p>
https://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/?comment=223478#post-id-223478rosrun camera_calibration cameracalibrator.py --size 9x6 --square 0.025 image:=/camera/image_raw camera:=/Mon, 04 Jan 2016 10:14:55 -0600https://answers.ros.org/question/198294/how-to-remap-service-commit-button-during-camera_calibration-doesnt-work/?comment=223478#post-id-223478