Skip to content

Commit

Permalink
temp
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBearing committed Sep 25, 2023
1 parent 7fd0c33 commit ff2e795
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 10 deletions.
4 changes: 2 additions & 2 deletions sanehal_bringup/launch/view_robot.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def generate_launch_description():
declared_arguments.append(
DeclareLaunchArgument(
"description_file",
default_value="diffbot.urdf.xacro",
default_value="diffbot_display.urdf.xacro",
description="URDF/XACRO description file with the robot.",
)
)
Expand All @@ -43,7 +43,7 @@ def generate_launch_description():
"prefix",
default_value='""',
description="Prefix of the joint names, useful for \
multi-robot setup. If changed than also joint names in the controllers' configuration \
multi-robot setup. If changed than also joint names in the controllers configuration \
have to be updated.",
)
)
Expand Down
10 changes: 8 additions & 2 deletions sanehal_vehicle_description/urdf/diffbot.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
<!-- Import diffbot ros2_control description -->
<xacro:include filename="$(find sanehal_vehicle_description)/ros2_control/diffbot.ros2_control.xacro" />

<xacro:diffbot prefix="$(arg prefix)" />

<link name="$(arg prefix)base_link" />
<xacro:diffbot
prefix="$(arg prefix)"
parent="$(arg prefix)base_link">
<origin
xyz="0 0 0"
rpy="0 0 0" />
</xacro:diffbot>
<xacro:diffbot_ros2_control
name="Sanehal" prefix="$(arg prefix)" />

Expand Down
19 changes: 13 additions & 6 deletions sanehal_vehicle_description/urdf/diffbot.xacro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- ロボットの表示を行う本体部分 -->
<xacro:macro name="diffbot" params="prefix parent">
<xacro:macro name="diffbot" params="prefix parent *origin">
<!-- Constants for robot dimensions -->
<xacro:property name="PI" value="3.1415926535897931"/>
<xacro:property name="base_mass" value="2.0" /> <!-- arbitrary value for base mass -->
Expand All @@ -22,7 +22,7 @@


<!-- Base Link -->
<link name="${prefix}base_link">
<link name="${prefix}sanehal_base_link">
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
Expand Down Expand Up @@ -50,7 +50,7 @@

<!-- Lidar sensor-->
<xacro:ld19
parent="${prefix}base_link"
parent="${prefix}sanehal_base_link"
prefix="${prefix}"
sensor_range_visible="false">
<origin xyz="0 0 0" rpy="0 0 0" />
Expand Down Expand Up @@ -138,26 +138,33 @@
</link>

<!-- joints -->

<joint
name="${prefix}base_joint"
type="fixed">
<parent link="${parent}" />
<child link="${prefix}sanehal_base_link" />
<xacro:insert_block name="origin" />
</joint>

<joint name="${prefix}left_wheel_joint" type="continuous">
<parent link="${prefix}base_link"/>
<parent link="${prefix}sanehal_base_link"/>
<child link="${prefix}left_wheel"/>
<origin xyz="${wheel_x_offset} ${base_width/2} ${z_offset}" rpy="0 0 0"/>
<axis xyz="0 1 0"/>
<dynamics damping="0.2"/>
</joint>

<joint name="${prefix}right_wheel_joint" type="continuous">
<parent link="${prefix}base_link"/>
<parent link="${prefix}sanehal_base_link"/>
<child link="${prefix}right_wheel"/>
<origin xyz="${wheel_x_offset} -${base_width/2} ${z_offset}" rpy="0 0 ${PI}"/>
<axis xyz="0 1 0"/>
<dynamics damping="0.2"/>
</joint>

<joint name="${prefix}caster_rear_wheel_joint" type="fixed">
<parent link="${prefix}base_link"/>
<parent link="${prefix}sanehal_base_link"/>
<child link="${prefix}caster_rear_wheel"/>
<origin xyz="${-base_width/2 + caster_wheel_radius} 0 ${z_offset}" rpy="0 0 0"/>
</joint>
Expand Down
19 changes: 19 additions & 0 deletions sanehal_vehicle_description/urdf/diffbot_display.urdf.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!-- Basic differential drive mobile base -->
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="diffdrive_robot">
<xacro:arg name="prefix" default="" />
<!-- Import Rviz colors -->
<xacro:include filename="$(find sanehal_vehicle_description)/gazebo/diffbot.materials.xacro" />

<xacro:include filename="$(find sanehal_vehicle_description)/urdf/diffbot.xacro" />

<link name="$(arg prefix)base_link" />
<xacro:diffbot
prefix="$(arg prefix)"
parent="$(arg prefix)base_link">
<origin
xyz="0 0 0"
rpy="0 0 0" />
</xacro:diffbot>

</robot>

0 comments on commit ff2e795

Please sign in to comment.