Commit c1d21ac8 authored by Raphael Lefevre's avatar Raphael Lefevre
Browse files

Adding desk model (wip)

parent b9eeb26d
<robot name="desk">
</robot>
<?xml version="1.0"?>
<robot name="case" xmlns:xacro="http://www.ros.org/wiki/xacro">
<material name="marine">
<color rgba="0 0.1 0.2 1"/>
</material>
<xacro:macro name="case" params="prefix planks_thickness case_sizeX case_sizeY case_sizeZ">
<link name="${prefix}_case_background">
<visual>
<geometry>
<box size="${case_sizeX} ${planks_thickness} ${case_sizeZ - planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="${case_sizeX} ${planks_thickness} ${case_sizeZ - planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
</collision>
</link>
<link name="${prefix}_case_bottom">
<visual>
<geometry>
<box size="${case_sizeX} ${case_sizeY} ${planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="${case_sizeX} ${case_sizeY} ${planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
</collision>
</link>
<joint name="${prefix}_case_background_bottom_joint" type="fixed">
<parent link="${prefix}_case_background"/>
<child link="${prefix}_case_bottom"/>
<origin xyz="0 ${(planks_thickness/2) - (case_sizeY/2)} ${-((case_sizeZ - planks_thickness)/2) - (planks_thickness/2)}" rpy="0 0 0"/>
</joint>
<link name="${prefix}_case_right">
<visual>
<geometry>
<box size="${planks_thickness} ${case_sizeY - planks_thickness} ${case_sizeZ - planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="${planks_thickness} ${case_sizeY - planks_thickness} ${case_sizeZ - planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
</collision>
</link>
<joint name="${prefix}_case_background_right_joint" type="fixed">
<parent link="${prefix}_case_background"/>
<child link="${prefix}_case_right"/>
<origin xyz="${(case_sizeX/2) - (planks_thickness/2)} ${-(planks_thickness/2) - ((case_sizeY - planks_thickness)/2)} 0" rpy="0 0 0"/>
</joint>
<link name="${prefix}_case_left">
<visual>
<geometry>
<box size="${planks_thickness} ${case_sizeY - planks_thickness} ${case_sizeZ - planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="${planks_thickness} ${case_sizeY - planks_thickness} ${case_sizeZ - planks_thickness}"/>
</geometry>
<origin xyz="0 0 0" rpy="0 0 0"/>
</collision>
</link>
<joint name="${prefix}_case_background_left_joint" type="fixed">
<parent link="${prefix}_case_background"/>
<child link="${prefix}_case_left"/>
<origin xyz="${-(case_sizeX/2) + (planks_thickness/2)} ${-(planks_thickness/2) - ((case_sizeY - planks_thickness)/2)} 0" rpy="0 0 0"/>
</joint>
</xacro:macro>
</robot>
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from desk.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="desk" xmlns:xacro="http://www.ros.org/wiki/xacro">
<material name="light_gray">
<color rgba="0.6 0.6 0.6 1"/>
</material>
<material name="dark_gray">
<color rgba="0.3 0.3 0.3 1"/>
</material>
<material name="marine">
<color rgba="0 0.1 0.2 1"/>
</material>
<link name="world"/>
<link name="board">
<visual>
<geometry>
<box size="2.5 1.5 0.05"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="dark_gray"/>
</visual>
<collision>
<geometry>
<box size="2.5 1.5 0.05"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<link name="right_body">
<visual>
<geometry>
<cylinder length="0.55" radius="0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="light_gray"/>
</visual>
<collision>
<geometry>
<cylinder length="0.55" radius="0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<link name="right_foot">
<visual>
<geometry>
<box size="0.05 1.5 0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="light_gray"/>
</visual>
<collision>
<geometry>
<box size="0.05 1.5 0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<joint name="right_body_foot_joint" type="fixed">
<parent link="right_body"/>
<child link="right_foot"/>
<origin rpy="0 0 0" xyz="0 0 -0.2875"/>
</joint>
<link name="left_body">
<visual>
<geometry>
<cylinder length="0.55" radius="0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="light_gray"/>
</visual>
<collision>
<geometry>
<cylinder length="0.55" radius="0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<link name="left_foot">
<visual>
<geometry>
<box size="0.05 1.5 0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="light_gray"/>
</visual>
<collision>
<geometry>
<box size="0.05 1.5 0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<joint name="left_body_foot_joint" type="fixed">
<parent link="left_body"/>
<child link="left_foot"/>
<origin rpy="0 0 0" xyz="0 0 -0.2875"/>
</joint>
<joint name="board_right_body_joint" type="fixed">
<parent link="board"/>
<child link="right_body"/>
<origin rpy="0 0 0" xyz="1.225 0 -0.3"/>
</joint>
<joint name="board_left_body_joint" type="fixed">
<parent link="board"/>
<child link="left_body"/>
<origin rpy="0 0 0" xyz="-1.225 0 -0.3"/>
</joint>
<joint name="world_board_joint" type="fixed">
<parent link="world"/>
<child link="board"/>
<origin rpy="0 0 0" xyz="0 0 0.6"/>
</joint>
<link name="upper_case_background">
<visual>
<geometry>
<box size="0.833333333333 0.025 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="0.833333333333 0.025 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<link name="upper_case_bottom">
<visual>
<geometry>
<box size="0.833333333333 0.775 0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="0.833333333333 0.775 0.025"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<joint name="upper_case_background_bottom_joint" type="fixed">
<parent link="upper_case_background"/>
<child link="upper_case_bottom"/>
<origin rpy="0 0 0" xyz="0 -0.375 -0.1125"/>
</joint>
<link name="upper_case_right">
<visual>
<geometry>
<box size="0.025 0.75 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="0.025 0.75 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<joint name="upper_case_background_right_joint" type="fixed">
<parent link="upper_case_background"/>
<child link="upper_case_right"/>
<origin rpy="0 0 0" xyz="0.404166666666 -0.3875 0"/>
</joint>
<link name="upper_case_left">
<visual>
<geometry>
<box size="0.025 0.75 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
<material name="marine"/>
</visual>
<collision>
<geometry>
<box size="0.025 0.75 0.2"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
</link>
<joint name="upper_case_background_left_joint" type="fixed">
<parent link="upper_case_background"/>
<child link="upper_case_left"/>
<origin rpy="0 0 0" xyz="-0.404166666666 -0.3875 0"/>
</joint>
<joint name="board_upper_case_background_joint" type="fixed">
<parent link="board"/>
<child link="upper_case_background"/>
<origin rpy="0 0 0" xyz="0.783333333333 0.0125 -0.125"/>
</joint>
</robot>
<?xml version="1.0"?>
<robot name="desk" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="table.urdf.xacro"/>
<xacro:include filename="case.urdf.xacro"/>
<link name="world"/>
<xacro:property name="board_h" value="0.6"/>
<xacro:property name="board_sX" value="2.5"/>
<xacro:property name="board_sY" value="1.5"/>
<xacro:property name="board_sZ" value="0.05"/>
<xacro:property name="planks_width" value="0.025"/>
<xacro:property name="leg_foot_sX" value="0.05"/>
<xacro:table board_height="${board_h}" board_sizeX="${board_sX}" board_sizeY="${board_sY}" board_sizeZ="${board_sZ}" leg_foot_sizeX="${leg_foot_sX}" leg_foot_sizeZ="0.025"/>
<joint name="world_board_joint" type="fixed">
<parent link="world"/>
<child link="board"/>
<origin xyz="0 0 ${board_h}" rpy="0 0 0"/>
</joint>
<xacro:case prefix="upper" planks_thickness="${planks_width}" case_sizeX="${board_sX/3}" case_sizeY="${(board_sY/2) + planks_width}" case_sizeZ="${(board_h/3) + planks_width}"/>
<joint name="board_upper_case_background_joint" type="fixed">
<parent link="board"/>
<child link="upper_case_background"/>
<origin xyz="${(board_sX/2) - ((board_sX/3)/2) - (leg_foot_sX)} ${planks_width/2} ${(-board_sZ/2) - ((board_h/3)/2)}" rpy="0 0 0"/>
</joint>
</robot>
<?xml version="1.0"?>
<robot name="desk" xmlns:xacro="http://www.ros.org/wiki/xacro">
<material name="dark_gray">
<color rgba="0.3 0.3 0.3 1"/>
</material>
<material name="light_gray">
<color rgba="0.6 0.6 0.6 1"/>
</material>
<material name="marine">
<color rgba="0 0.1 0.2 1"/>
</material>
<material name="light_turquoise">
<color rgba="0 0.6 0.6 1"/>
</material>
<material name="light_purple">
<color rgba="0.3 0.3 0.6 1"/>
</material>
<xacro:property name="scene_orientation" value="0 0 0"/> <!-- Must not be modified -->
<!-- ***************************************************** -->
<!-- ******************** Build table ******************** -->
<!-- ***************************************************** -->
<!-- xacro properties -->
<xacro:property name="board_posX" value="0"/>
<xacro:property name="board_posY" value="0"/>
<xacro:property name="board_posZ" value="0.6"/>
<xacro:property name="board_sizeX" value="2.5"/>
<xacro:property name="board_sizeY" value="1.2"/>
<xacro:property name="board_sizeZ" value="0.05"/>
<xacro:property name="leg_foot_sizeX" value="0.05"/>
<xacro:property name="leg_foot_sizeY" value="${board_sizeY}"/>
<xacro:property name="leg_foot_sizeZ" value="0.025"/>
<xacro:property name="leg_foot_size" value="${leg_foot_sizeX} ${leg_foot_sizeY} ${leg_foot_sizeZ}"/>
<xacro:property name="leg_body_length" value="${board_posZ - leg_foot_sizeZ - (board_sizeZ/2)}"/>
<xacro:property name="leg_body_radius" value="${leg_foot_sizeX/2}"/>
<xacro:property name="board_size" value="${board_sizeX} ${board_sizeY} ${board_sizeZ}"/>
<xacro:property name="board_position" value="${board_posX} ${board_posY} ${board_posZ}"/>
<xacro:property name="rleg_posX" value="${board_posX + ((board_sizeX/2) - leg_body_radius)}"/>
<xacro:property name="rleg_posY" value="${board_posY}"/>
<xacro:property name="rleg_body_position" value="${rleg_posX} ${rleg_posY} ${(leg_body_length/2)+leg_foot_sizeZ}"/>
<xacro:property name="rleg_foot_position" value="${rleg_posX} ${rleg_posY} ${leg_foot_sizeZ/2}"/>
<xacro:property name="lleg_posX" value="${board_posX - ((board_sizeX/2) - leg_body_radius)}"/>
<xacro:property name="lleg_posY" value="${board_posY}"/>
<xacro:property name="lleg_body_position" value="${lleg_posX} ${lleg_posY} ${(leg_body_length/2)+leg_foot_sizeZ}"/>
<xacro:property name="lleg_foot_position" value="${lleg_posX} ${lleg_posY} ${leg_foot_sizeZ/2}"/>
<!-- Board -->
<link name="board">
<visual>
<geometry>
<box size="${board_size}"/>
</geometry>
<material name="dark_gray"/>
<origin xyz="${board_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<box size="${board_size}"/>
</geometry>
<origin xyz="${board_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<!-- Right table leg -->
<link name="rleg_body">
<visual>
<geometry>
<cylinder length="${leg_body_length}" radius="${leg_body_radius}"/>
</geometry>
<material name="light_gray"/>
<origin xyz="${rleg_body_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<cylinder length="${leg_body_length}" radius="${leg_body_radius}"/>
</geometry>
<origin xyz="${rleg_body_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<link name="rleg_foot">
<visual>
<geometry>
<box size="${leg_foot_size}"/>
</geometry>
<material name="light_gray"/>
<origin xyz="${rleg_foot_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<box size="${leg_foot_size}"/>
</geometry>
<origin xyz="${rleg_foot_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<joint name="rleg_board_body_joint" type="fixed">
<parent link="board"/>
<child link="rleg_body"/>
</joint>
<joint name="rleg_body_foot_joint" type="fixed">
<parent link="rleg_body"/>
<child link="rleg_foot"/>
</joint>
<!-- Left table leg -->
<link name="lleg_body">
<visual>
<geometry>
<cylinder length="${leg_body_length}" radius="${leg_body_radius}"/>
</geometry>
<material name="light_gray"/>
<origin xyz="${lleg_body_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<cylinder length="${leg_body_length}" radius="${leg_body_radius}"/>
</geometry>
<origin xyz="${lleg_body_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<link name="lleg_foot">
<visual>
<geometry>
<box size="${leg_foot_size}"/>
</geometry>
<material name="light_gray"/>
<origin xyz="${lleg_foot_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<box size="${leg_foot_size}"/>
</geometry>
<origin xyz="${lleg_foot_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<joint name="lleg_board_body_joint" type="fixed">
<parent link="board"/>
<child link="lleg_body"/>
</joint>
<joint name="lleg_body_foot_joint" type="fixed">
<parent link="lleg_body"/>
<child link="lleg_foot"/>
</joint>
<!-- **************************************************** -->
<!-- ******************** Build case ******************** -->
<!-- **************************************************** -->
<!-- xacro properties -->
<xacro:property name="planks_thickness" value="0.025"/>
<xacro:property name="background_plank_sizeX" value="${board_sizeX/3}"/>
<xacro:property name="background_plank_sizeY" value="${planks_thickness}"/>
<xacro:property name="background_plank_sizeZ" value="${board_posZ/3}"/>
<xacro:property name="background_plank_size" value="${background_plank_sizeX} ${background_plank_sizeY} ${background_plank_sizeZ}"/>
<xacro:property name="background_plank_posX" value="${board_posX + (board_sizeX/2) - (background_plank_sizeX/2) - (leg_body_radius*2)}"/>
<xacro:property name="background_plank_posY" value="${board_posY + (background_plank_sizeY/2)}"/>
<xacro:property name="background_plank_posZ" value="${board_posZ - (board_sizeZ/2) - (background_plank_sizeZ/2)}"/>
<xacro:property name="background_plank_position" value="${background_plank_posX} ${background_plank_posY} ${background_plank_posZ}"/>
<xacro:property name="bottom_plank_sizeX" value="${background_plank_sizeX}"/>
<xacro:property name="bottom_plank_sizeY" value="${(board_sizeY/2) + background_plank_sizeY}"/>
<xacro:property name="bottom_plank_sizeZ" value="${planks_thickness}"/>
<xacro:property name="bottom_plank_size" value="${bottom_plank_sizeX} ${bottom_plank_sizeY} ${bottom_plank_sizeZ}"/>
<xacro:property name="bottom_plank_posX" value="${background_plank_posX}"/>
<xacro:property name="bottom_plank_posY" value="${background_plank_posY + (background_plank_sizeY/2) - (bottom_plank_sizeY/2)}"/>
<xacro:property name="bottom_plank_posZ" value="${background_plank_posZ - (background_plank_sizeZ/2) - (bottom_plank_sizeZ/2)}"/>
<xacro:property name="bottom_plank_position" value="${bottom_plank_posX} ${bottom_plank_posY} ${bottom_plank_posZ}"/>
<xacro:property name="side_planks_sizeX" value="${planks_thickness}"/>
<xacro:property name="side_planks_sizeY" value="${bottom_plank_sizeY - background_plank_sizeY}"/>
<xacro:property name="side_planks_sizeZ" value="${background_plank_sizeZ}"/>
<xacro:property name="side_planks_size" value="${side_planks_sizeX} ${side_planks_sizeY} ${side_planks_sizeZ}"/>
<xacro:property name="rside_plank_posX" value="${bottom_plank_posX + (bottom_plank_sizeX/2) - (side_planks_sizeX/2)}"/>
<xacro:property name="rside_plank_posY" value="${background_plank_posY - (background_plank_sizeY/2) - (side_planks_sizeY/2)}"/>
<xacro:property name="rside_plank_posZ" value="${bottom_plank_posZ + (bottom_plank_sizeZ/2) + (side_planks_sizeZ/2)}"/>
<xacro:property name="rside_plank_position" value="${rside_plank_posX} ${rside_plank_posY} ${rside_plank_posZ}"/>
<xacro:property name="lside_plank_posX" value="${bottom_plank_posX - (bottom_plank_sizeX/2) + (side_planks_sizeX/2)}"/>
<xacro:property name="lside_plank_posY" value="${background_plank_posY - (background_plank_sizeY/2) - (side_planks_sizeY/2)}"/>
<xacro:property name="lside_plank_posZ" value="${bottom_plank_posZ + (bottom_plank_sizeZ/2) + (side_planks_sizeZ/2)}"/>
<xacro:property name="lside_plank_position" value="${lside_plank_posX} ${lside_plank_posY} ${lside_plank_posZ}"/>
<!-- Background plank -->
<link name="background_plank">
<visual>
<geometry>
<box size="${background_plank_size}"/>
</geometry>
<material name="marine"/>
<origin xyz="${background_plank_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<box size="${background_plank_size}"/>
</geometry>
<origin xyz="${background_plank_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<joint name="case_board_background_plank_joint" type="fixed">
<parent link="board"/>
<child link="background_plank"/>
</joint>
<!-- Bottom plank -->
<link name="bottom_plank">
<visual>
<geometry>
<box size="${bottom_plank_size}"/>
</geometry>
<material name="marine"/>
<origin xyz="${bottom_plank_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<box size="${bottom_plank_size}"/>
</geometry>
<origin xyz="${bottom_plank_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<joint name="case_background_bottom_joint" type="fixed">
<parent link="background_plank"/>
<child link="bottom_plank"/>
</joint>
<!-- Right side plank -->
<link name="right_side_plank">
<visual>
<geometry>
<box size="${side_planks_size}"/>
</geometry>
<material name="marine"/>
<origin xyz="${rside_plank_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<box size="${side_planks_size}"/>
</geometry>
<origin xyz="${rside_plank_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<joint name="case_bottom_right_side_joint" type="fixed">
<parent link="bottom_plank"/>
<child link="right_side_plank"/>
</joint>
<!-- Left side plank -->
<link name="left_side_plank">
<visual>
<geometry>
<box size="${side_planks_size}"/>
</geometry>
<material name="marine"/>
<origin xyz="${lside_plank_position}" rpy="${scene_orientation}"/>
</visual>
<collision>
<geometry>
<box size="${side_planks_size}"/>
</geometry>
<origin xyz="${lside_plank_position}" rpy="${scene_orientation}"/>
</collision>
</link>
<joint name="case_bottom_left_side_joint" type="fixed">