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.
You can add a 1.57 rad rotation on the z axis. <pose>0 0 0 0 0 1.57</pose> in your camera link.
I have done as follows: <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> <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> Do you think it is correct?
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 : <limit lower="0" upper="0" effort="10" velocity="10"/>
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?
I have no idea on this one, sorry.