Skip to content

Commit

Permalink
Enable/Disable ultrasounds. Rearrange URDF for rpanther/panther_simul…
Browse files Browse the repository at this point in the history
  • Loading branch information
rbonghi committed Apr 22, 2020
1 parent 8832615 commit 04b35e9
Show file tree
Hide file tree
Showing 9 changed files with 199 additions and 105 deletions.
54 changes: 52 additions & 2 deletions panther_bringup/rviz/panther.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Panels:
- /Status1
- /TF1/Frames1
- /TF1/Tree1
- /Ultrasounds1
- /DepthCloud1/Auto Size1
Splitter Ratio: 0.5
Tree Height: 535
Expand Down Expand Up @@ -65,6 +66,21 @@ Visualization Manager:
Expand Link Details: false
Expand Tree: false
Link Tree Style: Links in Alphabetic Order
SFR10_left_frame:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
SFR10_rear_frame:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
SFR10_right_frame:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
antenna_link:
Alpha: 1
Show Axes: false
Expand Down Expand Up @@ -362,6 +378,40 @@ Visualization Manager:
Value: true
Enabled: true
Name: axis
- Class: rviz/Group
Displays:
- Alpha: 0.5
Buffer Length: 1
Class: rviz/Range
Color: 173; 127; 168
Enabled: true
Name: SFR10 Left
Queue Size: 100
Topic: /panther/body/SFR10/left
Unreliable: false
Value: true
- Alpha: 0.5
Buffer Length: 1
Class: rviz/Range
Color: 173; 127; 168
Enabled: true
Name: SFR10 Right
Queue Size: 100
Topic: /panther/body/SFR10/right
Unreliable: false
Value: true
- Alpha: 0.5
Buffer Length: 1
Class: rviz/Range
Color: 173; 127; 168
Enabled: true
Name: SFR10 Rear
Queue Size: 100
Topic: /panther/body/SFR10/rear
Unreliable: false
Value: true
Enabled: true
Name: Ultrasounds
- Alpha: 1
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Expand Down Expand Up @@ -494,5 +544,5 @@ Window Geometry:
Views:
collapsed: true
Width: 1188
X: 0
Y: 21
X: 67
Y: 27
4 changes: 3 additions & 1 deletion panther_description/launch/description.launch
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,16 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<arg name="jetson" default="xavier" />
<arg name="motor_board" default="roboteq" />
<arg name="ssd" default="false" />
<arg name="ultrasounds" default="false" />

<!-- Send the Panther Robot URDF/XACRO to param server -->
<param name="robot_description"
command="$(find xacro)/xacro '$(find panther_description)/urdf/panther.urdf.xacro'
zed_model:=$(arg zed_model)
jetson:=$(arg jetson)
motor_board:=$(arg motor_board)
ssd:=$(arg ssd)"
ssd:=$(arg ssd)
ultrasounds:=$(arg ultrasounds)"
/>

<!-- Activate node to propagate the joint state -->
Expand Down
Binary file added panther_description/meshes/boards/xavier_link.stl
Binary file not shown.
Binary file modified panther_description/meshes/chassis/cover_link.STL
100644 → 100755
Binary file not shown.
1 change: 0 additions & 1 deletion panther_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

<buildtool_depend>catkin</buildtool_depend>

<!-- TODO: Check if require another more dependencies -->
<exec_depend>joint_state_publisher_gui</exec_depend>
<exec_depend>xacro</exec_depend>

Expand Down
5 changes: 3 additions & 2 deletions panther_description/urdf/boards/jetson.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<xacro:if value="${model == 'xavier'}">
<link name="jetson_carrier_link">
<visual>
<origin xyz="0 0 0.025" rpy="0 0 0" />
<origin xyz="-0.047 0.048 0.011" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<geometry>
<box size="0.12 0.12 0.05" />
<!--<box size="0.12 0.12 0.05" />-->
<mesh filename="${path_meshes}/boards/xavier_link.stl"/>
</geometry>
<material name="Black" />
</visual>
Expand Down
2 changes: 1 addition & 1 deletion panther_description/urdf/chassis/chassis.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
izz="0.0140947881519727" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 ${M_PI}" />
<origin xyz="0 0 0.0788" rpy="0 0 ${M_PI}" />
<geometry>
<mesh filename="${path_meshes}/chassis/cover_link.STL" />
</geometry>
Expand Down
111 changes: 13 additions & 98 deletions panther_description/urdf/panther.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -27,104 +27,19 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<robot name="panther" xmlns:xacro="http://ros.org/wiki/xacro">

<xacro:include filename="$(find panther_description)/urdf/materials.urdf" />
<!-- Panther parts -->
<xacro:include filename="$(find panther_description)/urdf/chassis/chassis.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/chassis/stand.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/chassis/battery.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/track/track.urdf.xacro" />
<!-- Sensors -->
<xacro:include filename="$(find panther_description)/urdf/sensors/ultrasounds.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/sensors/imu.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/sensors/rplidar.urdf.xacro" />
<xacro:include filename="$(find zed_wrapper)/urdf/zed.urdf.xacro" /> <!-- ZED external xacro -->
<!-- Boards -->
<xacro:include filename="$(find panther_description)/urdf/boards/jetson.urdf.xacro" />

<xacro:include filename="$(find panther_description)/urdf/robot.urdf.xacro" />
<!-- Arguments -->
<xacro:arg name="zed_model" default="zed2"/> <!-- Follow zed_repository -->
<xacro:arg name="jetson" default="xavier"/> <!-- options: tx, xavier -->
<xacro:arg name="motor_board" default="roboteq"/> <!-- options: unav, roboteq -->
<xacro:arg name="ssd" default="false"/>

<!-- Global properties -->
<xacro:property name="path_meshes" value="package://panther_description/meshes"/>
<xacro:property name="M_PI" value="3.14159"/>

<!-- Sprocket and gear properties -->
<xacro:property name="sprocket_radius" value="0.0325"/>
<xacro:property name="sprocket_leght" value="0.05"/>
<xacro:property name="sprocket_teeth" value="24"/>
<xacro:property name="gear_teeth" value="16"/>
<xacro:property name="wheel_offset_x" value="-0.00"/>
<xacro:property name="wheel_offset_y" value="0.08"/>
<xacro:property name="wheel_offset_z" value="${wheel_radius}"/>

<xacro:property name="mboard" value="$(arg motor_board)"/>

<!-- base_link -->
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry><cylinder length="0.001" radius="0.05"/></geometry>
<material name="Green" />
</visual>
</link>

<!-- Panther body -->
<xacro:chassis parent="base_link">
<origin xyz="0 0 0.08" rpy="0 0 0" />
</xacro:chassis>
<xacro:track type="left" parent="frame_link" />
<xacro:track type="right" parent="frame_link" />
<xacro:stand parent="frame_link" model="stand_rplidar_zed">
<origin xyz="-0.03600 0 0.1700" rpy="0 0 0" />
</xacro:stand>
<xacro:battery parent="frame_link" mass="0.24981">
<origin xyz="-0.13 0 0.01" rpy="0 0 0" />
</xacro:battery>
<xacro:if value="$(arg ssd)">
<xacro:include filename="$(find panther_description)/urdf/chassis/ssd.urdf.xacro" />
<xacro:ssd parent="frame_link">
<origin xyz="0.0465 0.03075 0.04674" rpy="${M_PI} 0 ${M_PI}" />
</xacro:ssd>
</xacro:if>

<!-- Sensors -->
<xacro:ultrasounds name="SFR10_left" parent="frame_link">
<origin xyz="0.15 0.095 -0.015" rpy="0 0 0" />
</xacro:ultrasounds>
<xacro:ultrasounds name="SFR10_right" parent="frame_link">
<origin xyz="0.15 -0.095 -0.015" rpy="0 0 0" />
</xacro:ultrasounds>
<xacro:ultrasounds name="SFR10_rear" parent="frame_link">
<origin xyz="-0.15 0 -0.015" rpy="${M_PI} ${M_PI} 0" />
</xacro:ultrasounds>
<xacro:razor_imu parent="frame_link">
<origin xyz="-0.0420817256507905 0 0.091441320597534" rpy="0 ${M_PI/2} 0" />
</xacro:razor_imu>
<xacro:zed parent="stand_link" camera_name="$(arg zed_model)" camera_model="$(arg zed_model)">
<origin xyz="0.028 0 0.021" rpy="0 0 0" />
</xacro:zed>
<xacro:rplidar parent="stand_link">
<origin xyz="-0.03 0 0.02" rpy="0 0 0" />
</xacro:rplidar>

<!-- Boards -->
<xacro:jetson parent="frame_link" model="$(arg jetson)">
<origin xyz="0.08 0 0.05" rpy="0 0 0" />
</xacro:jetson>
<xacro:if value="${mboard == 'unav'}">
<xacro:include filename="$(find panther_description)/urdf/boards/unav.urdf.xacro" />
<xacro:unav parent="frame_link">
<origin xyz="-0.10 0 0.12" rpy="0 0 0" />
</xacro:unav>
</xacro:if>
<xacro:if value="${mboard == 'roboteq'}">
<xacro:include filename="$(find panther_description)/urdf/boards/roboteq.urdf.xacro" />
<xacro:roboteq parent="frame_link">
<origin xyz="-0.11 0 0.12" rpy="0 0 0" />
</xacro:roboteq>
</xacro:if>
<xacro:arg name="zed_model" default="zed2"/> <!-- Follow zed_repository -->
<xacro:arg name="jetson" default="xavier"/> <!-- options: tx, xavier -->
<xacro:arg name="motor_board" default="roboteq"/> <!-- options: unav, roboteq -->
<xacro:arg name="ssd" default="false"/>
<xacro:arg name="ultrasounds" default="false"/>

<xacro:panther
zed_model="$(arg zed_model)"
jetson="$(arg jetson)"
motor_board="$(arg motor_board)"
ssd="$(arg ssd)"
ultrasounds="$(arg ultrasounds)" />

</robot>
127 changes: 127 additions & 0 deletions panther_description/urdf/robot.urdf.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
<?xml version="1.0"?>
<!--
Copyright (C) 2020, Raffaello Bonghi <[email protected]>
All rights reserved
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-->
<robot name="panther" xmlns:xacro="http://ros.org/wiki/xacro">

<xacro:include filename="$(find panther_description)/urdf/materials.urdf" />
<!-- Panther parts -->
<xacro:include filename="$(find panther_description)/urdf/chassis/chassis.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/chassis/stand.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/chassis/battery.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/track/track.urdf.xacro" />
<!-- Sensors -->
<xacro:include filename="$(find panther_description)/urdf/sensors/ultrasounds.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/sensors/imu.urdf.xacro" />
<xacro:include filename="$(find panther_description)/urdf/sensors/rplidar.urdf.xacro" />
<xacro:include filename="$(find zed_wrapper)/urdf/zed.urdf.xacro" /> <!-- ZED external xacro -->
<!-- Boards -->
<xacro:include filename="$(find panther_description)/urdf/boards/jetson.urdf.xacro" />

<!-- Global properties -->
<xacro:property name="M_PI" value="3.14159"/>
<xacro:property name="path_meshes" value="package://panther_description/meshes"/>

<!-- Sprocket and gear properties -->
<xacro:property name="sprocket_radius" value="0.0325"/>
<xacro:property name="sprocket_leght" value="0.05"/>
<xacro:property name="sprocket_teeth" value="24"/>
<xacro:property name="gear_teeth" value="16"/>
<xacro:property name="wheel_offset_x" value="-0.00"/>
<xacro:property name="wheel_offset_y" value="0.08"/>
<xacro:property name="wheel_offset_z" value="${wheel_radius}"/>

<xacro:macro name="panther" params="zed_model jetson motor_board ssd ultrasounds">

<!-- base_link -->
<link name="base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry><cylinder length="0.001" radius="0.05"/></geometry>
<material name="Green" />
</visual>
</link>

<!-- Panther body -->
<xacro:chassis parent="base_link">
<origin xyz="0 0 0.08" rpy="0 0 0" />
</xacro:chassis>
<xacro:track type="left" parent="frame_link" />
<xacro:track type="right" parent="frame_link" />
<xacro:stand parent="frame_link" model="stand_rplidar_zed">
<origin xyz="-0.03600 0 0.1700" rpy="0 0 0" />
</xacro:stand>
<xacro:battery parent="frame_link" mass="0.24981">
<origin xyz="-0.13 0 0.01" rpy="0 0 0" />
</xacro:battery>
<xacro:if value="${ssd}">
<xacro:include filename="$(find panther_description)/urdf/chassis/ssd.urdf.xacro" />
<xacro:ssd parent="frame_link">
<origin xyz="0.0465 0.03075 0.04674" rpy="${M_PI} 0 ${M_PI}" />
</xacro:ssd>
</xacro:if>

<!-- Sensors -->
<xacro:if value="${ultrasounds}">
<xacro:ultrasounds name="SFR10_left" parent="frame_link">
<origin xyz="0.15 0.095 -0.015" rpy="0 0 0" />
</xacro:ultrasounds>
<xacro:ultrasounds name="SFR10_right" parent="frame_link">
<origin xyz="0.15 -0.095 -0.015" rpy="0 0 0" />
</xacro:ultrasounds>
<xacro:ultrasounds name="SFR10_rear" parent="frame_link">
<origin xyz="-0.15 0 -0.015" rpy="${M_PI} ${M_PI} 0" />
</xacro:ultrasounds>
</xacro:if>
<xacro:razor_imu parent="frame_link">
<origin xyz="-0.0420817256507905 0 0.091441320597534" rpy="0 ${M_PI/2} 0" />
</xacro:razor_imu>
<xacro:zed parent="stand_link" camera_name="${zed_model}" camera_model="${zed_model}">
<origin xyz="0.028 0 0.021" rpy="0 0 0" />
</xacro:zed>
<xacro:rplidar parent="stand_link">
<origin xyz="-0.03 0 0.02" rpy="0 0 0" />
</xacro:rplidar>

<!-- Boards -->
<xacro:jetson parent="frame_link" model="${jetson}">
<origin xyz="0.08 0 0.05" rpy="0 0 0" />
</xacro:jetson>
<xacro:if value="${motor_board == 'unav'}">
<xacro:include filename="$(find panther_description)/urdf/boards/unav.urdf.xacro" />
<xacro:unav parent="frame_link">
<origin xyz="-0.10 0 0.12" rpy="0 0 0" />
</xacro:unav>
</xacro:if>
<xacro:if value="${motor_board == 'roboteq'}">
<xacro:include filename="$(find panther_description)/urdf/boards/roboteq.urdf.xacro" />
<xacro:roboteq parent="frame_link">
<origin xyz="-0.11 0 0.12" rpy="0 0 0" />
</xacro:roboteq>
</xacro:if>
</xacro:macro>

</robot>

0 comments on commit 04b35e9

Please sign in to comment.