Home | Tutorials | Wiki | Issues
Ask Your Question
1

Can the optical frame orientation be set via pose in sensor

asked 2013-11-15 11:03:07 -0500

rnunziata gravatar image

updated 2013-11-19 03:30:44 -0500

Update:
I can rotate the physical frame using the pose element. I do not want to move the camera as its image is correct it is the orientation of the optical that is not oriented in rviz correctly. Do I have to manually (in code) translate or is there a way to normalize these coordinate system to each other. Hopefully I asked the question correctly this time.

This following statement is incorrect as the pose does not rotate the optical frame. XY pose work fine.

I was trying to rotate my depth camera by doing the following: The z rotation takes effect but the XY rotation are ignored. I understand it is normal to create a joint for this but I was wonder why I can not do it here.

   <sensor name="camera1" type="depth">
           <visualize>1</visualize>
           <pose>-0.1 0 0.2 -1.57 0 -1.57</pose>
           <camera name='head'>
               <horizontal_fov>1.39626</horizontal_fov>
               <image>
                  <width>800</width>
                  <height>800</height>
                  <format>R8G8B8</format>
               </image>
               <clip>
                 <near>0.02</near>
                 <far>300</far>
               </clip>
               <save enabled="false"> 
                  <path>/tmp</path>
               </save>
               <depth_camera>
                  <output>depthImage</output>
               </depth_camera>
               <noise>
                  <type>gaussian</type>
                  <mean>0</mean>
                  <stddev>0.007</stddev>
               </noise>
            </camera>

<plugin name="head_camera_controller" filename="libgazebo_ros_openni_kinect.so">
    <baseline>0.2</baseline>
    <alwaysOn>true</alwaysOn>
    <updateRate>1.0</updateRate>

              <cameraName>camera1</cameraName>
              <frameName>camera_frame</frameName>
              <imageTopicName>/image_raw</imageTopicName>
              <cameraInfoTopicName>/camera_info</cameraInfoTopicName>
              <depthImageTopicName>/camera/image_raw</depthImageTopicName>
              <depthImageCameraInfoTopicName>/camera_info</depthImageCameraInfoTopicName>
              <pointCloudTopicName>/depth/points</pointCloudTopicName>

    <pointCloudCutoff>0.5</pointCloudCutoff>

    <CxPrime>0</CxPrime>
    <Cx>0</Cx>
    <Cy>0</Cy>
    <focalLength>0</focalLength>
    <hackBaseline>0</hackBaseline>
  </plugin>
edit retag flag offensive close merge delete

Comments

XY rotation should work. How are you determining that the rotation is not working?

nkoenig gravatar imagenkoenig ( 2013-11-18 16:10:30 -0500 )edit

It did rotate for Z but not Y. I will try again to double check and post image. I am verifying in RVIZ.

rnunziata gravatar imagernunziata ( 2013-11-18 16:31:52 -0500 )edit

if you are working on gazebo 2.0 or later, watchout for this bug https://bitbucket.org/osrf/gazebo/issue/920/camera-rotation-error. This should have been fixed in the latest 2.1.0 release (https://bitbucket.org/osrf/gazebo/src/eed181a68859e55176b134230a910764d86f87c3/Changelog.md?at=default)

hsu gravatar imagehsu ( 2013-11-18 17:56:44 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-11-21 06:46:05 -0500

rnunziata gravatar image

I was able to use the static transform publisher in ros to map the camera optical frame to the base_link.

edit flag offensive delete link more
0

answered 2013-11-18 17:53:32 -0500

hsu gravatar image

Per testing in gazebo 1.9 with this world, the rotation in x-axis seems to have made a difference.

edit flag offensive delete link more

Comments

updated question for clearity

rnunziata gravatar imagernunziata ( 2013-11-19 02:49:00 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-11-15 11:03:07 -0500

Seen: 1,274 times

Last updated: Nov 21 '13