Change camera orientation
Referring to the attached figure, How can I change the camera orientation so that the beer can will be visible when placed to the front of the robot?
I have fixed the orientation by acting on the camera_joint rpy, as shown in the following:
<joint name="camera_joint" type="fixed">
<origin xyz="${2*camera_link} ${height + 2*axel_offset} 0" rpy="0 0 1.57"/>
<parent link="link4"/>
<child link="camera_link"/>
</joint>
<!-- Camera -->
<link name="camera_link">
<collision>
<origin xyz="0 ${camera_link + axel_offset} 0" rpy="0 0 0"/>
<geometry>
<box size="${camera_link} ${camera_link} ${camera_link}"/>
</geometry>
</collision>
<visual>
<origin xyz="0 ${camera_link + axel_offset} 0" rpy="0 0 0"/>
<geometry>
<box size="${camera_link} ${camera_link} ${camera_link}"/>
</geometry>
<material name="red"/>
</visual>
<inertial>
<mass value="1e-5" />
<origin xyz="0 ${camera_link + axel_offset} 0" rpy="0 0 0"/>
<inertia ixx="1e-6" ixy="0" ixz="0" iyy="1e-6" iyz="0" izz="1e-6" />
</inertial>
</link>
however, now the camera view seems obstructed by an edge of the camera box.
Asked by Filippo Sanfilippo on 2016-05-06 15:48:25 UTC
Answers
I guess you set camera_link as reference for camera plugin. The problem is that camera is attached to the origin of camera_link, which is in the body of the box. Solution A: add another joint and virtual link (without view tag) to move camera to the surface of the box. Solution B: make camera_link virtual/transparent
Asked by chaolmu on 2018-10-23 14:34:24 UTC
Comments
You can add a 1.57 rad rotation on the z axis.0 0 0 0 0 1.57 in your camera link.
Asked by Brosseau.F on 2016-05-09 02:10:04 UTC
I have done as follows:
<!-- Camera -->
Do you think it is correct?
Asked by Filippo Sanfilippo on 2016-05-09 03:26:55 UTC
It seems right. But I don't see why the rotation is not applied.
Try to add the tag of my previous comment in the sensor tag.
To do a fixed joint in URD, I set the type to revolute and I add the following line :
Asked by Brosseau.F on 2016-05-09 04:04:00 UTC
Thank you for your comment. I followed your suggestion. However, now the camera view seems obstructed by an edge of the camera box. Please have a look of the new figure added above to the original post. Any ideas?
Asked by Filippo Sanfilippo on 2016-05-16 07:05:33 UTC
I have no idea on this one, sorry.
Asked by Brosseau.F on 2016-05-18 02:34:03 UTC