course2_ws/my_robot1_description/urdf_his/arm.xacro

84 lines
3.3 KiB
Plaintext
Raw Permalink Normal View History

2024-12-19 00:49:29 +00:00
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:property name="arm_base_length" value="0.1" />
<xacro:property name="arm_base_width" value="0.1" />
<xacro:property name="arm_base_height" value="0.02" />
<xacro:property name="forearm_radius" value="0.02" />
<xacro:property name="forearm_length" value="0.3" />
<xacro:property name="hand_radius" value="0.02" />
<xacro:property name="hand_length" value="0.3" />
<link name="arm_base_link">
<visual>
<geometry>
<box size="${arm_base_length} ${arm_base_width} ${arm_base_height}" />
</geometry>
<origin xyz="0 0 ${arm_base_height / 2.0}" rpy="0 0 0" />
<material name="orange" />
</visual>
<collision>
<geometry>
<box size="${arm_base_length} ${arm_base_width} ${arm_base_height}" />
</geometry>
<origin xyz="0 0 ${arm_base_height / 2.0}" rpy="0 0 0" />
</collision>
<xacro:box_inertia m="0.5" l="${2*arm_base_length}" w="${2*arm_base_width}" h="${2*arm_base_height}"
xyz="0 0 ${arm_base_height / 2.0}" rpy="0 0 0" />
</link>
<link name="forearm_link">
<visual>
<geometry>
<cylinder radius="${forearm_radius}" length="${forearm_length}" />
</geometry>
<origin xyz="0 0 ${forearm_length / 2.0}" rpy="0 0 0" />
<material name="yellow" />
</visual>
<collision>
<geometry>
<cylinder radius="${forearm_radius}" length="${forearm_length}" />
</geometry>
<origin xyz="0 0 ${forearm_length / 2.0}" rpy="0 0 0" />
</collision>
<xacro:cylinder_inertia m="0.3" r="${2*forearm_radius}" h="${2*forearm_length}"
xyz="0 0 ${forearm_length / 2.0}" rpy="0 0 0" />
</link>
<link name="hand_link">
<visual>
<geometry>
<cylinder radius="${hand_radius}" length="${hand_length}" />
</geometry>
<origin xyz="0 0 ${hand_length / 2.0}" rpy="0 0 0" />
<material name="orange" />
</visual>
<collision>
<geometry>
<cylinder radius="${hand_radius}" length="${hand_length}" />
</geometry>
<origin xyz="0 0 ${hand_length / 2.0}" rpy="0 0 0" />
</collision>
<xacro:cylinder_inertia m="0.3" r="${2*hand_radius}" h="${2*hand_length}"
xyz="0 0 ${hand_length / 2.0}" rpy="0 0 0" />
</link>
<joint name="arm_base_forearm_joint" type="revolute">
<parent link="arm_base_link" />
<child link="forearm_link" />
<origin xyz="0 0 ${arm_base_height}" rpy="0 0 0" />
<axis xyz="0 1 0" />
<limit lower="0" upper="${pi/2}" effort="100" velocity="100" />
<dynamics friction="0.05" damping="0.1" />
</joint>
<joint name="forearm_hand_joint" type="revolute">
<parent link="forearm_link" />
<child link="hand_link" />
<origin xyz="0 0 ${forearm_length}" rpy="0 0 0" />
<axis xyz="0 1 0" />
<limit lower="0" upper="${pi/2}" effort="100" velocity="100" />
<dynamics friction="0.05" damping="0.1" />
</joint>
</robot>