forked from czhherry/self-driving-vehicle-101
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 04 introduction to urdf with a box model
- Loading branch information
Showing
5 changed files
with
122 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<launch> | ||
|
||
<include file="$(find box)/launch/spawn_xacro.launch"> | ||
|
||
<arg name="x" value="0.0"/> | ||
<arg name="y" value="0.0"/> | ||
<arg name="z" value="0.0"/> | ||
<arg name="urdf_robot_file" value="$(find box)/urdf/box.xacro"/> | ||
<arg name="robot_name" value="my_box"/> | ||
|
||
</include> | ||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<launch> | ||
|
||
<include file="$(find box)/launch/spawn_xacro.launch"> | ||
|
||
<arg name="x" value="0.0"/> | ||
<arg name="y" value="0.0"/> | ||
<arg name="z" value="0.0"/> | ||
<arg name="urdf_robot_file" value="$(find box)/urdf/box.xacro"/> | ||
<arg name="robot_name" value="my_box"/> | ||
|
||
</include> | ||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<launch> | ||
|
||
<arg name="x" default="0.0"/> | ||
<arg name="y" default="0.0"/> | ||
<arg name="z" default="0.0"/> | ||
|
||
<arg name="urdf_robot_file" default=""/> | ||
<arg name="robot_name" default=""/> | ||
|
||
<!-- <param name="robot_description" command="$(arg urdf_robot_file)"/> --> | ||
<param name="robot_description" command="$(find xacro)/xacro '$(arg urdf_robot_file)' roboname:='$(arg robot_name)'" /> | ||
|
||
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -x $(arg x) -y $(arg y) -z $(arg z) -model $(arg robot_name) -param robot_description"/> | ||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<robot name="box"> | ||
<link name="base_link"> | ||
<collision> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
<geometry> | ||
<box size="1 1 1"/> | ||
</geometry> | ||
</collision> | ||
<visual> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
<geometry> | ||
<box size="1 1 1"/> | ||
</geometry> | ||
</visual> | ||
</link> | ||
|
||
<joint name="inertial_joint" type="fixed"> | ||
<parent link="base_link"/> | ||
<child link="main_mass"/> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
</joint> | ||
|
||
<link name="main_mass" type="fixed"> | ||
<parent link="inertial_joint"/> | ||
<inertial> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
<mass value="1000"/> | ||
<inertia | ||
ixx="166.6666" ixy="0.000000" ixz="0.000000" | ||
iyy="166.6666" iyz="0.000000" | ||
izz="166.6666"/> | ||
</inertial> | ||
</link> | ||
</robot> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" ?> | ||
|
||
<robot name="box" xmlns:xacro="http://www.ros.org/wiki/xacro"> | ||
|
||
<xacro:property name="length" value="1"/> | ||
<xacro:property name="width" value="1"/> | ||
<xacro:property name="height" value="1"/> | ||
|
||
<link name="base_link"> | ||
<collision> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
<geometry> | ||
<box size="${length} ${width} ${height}"/> | ||
</geometry> | ||
</collision> | ||
<visual> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
<geometry> | ||
<box size="${length} ${width} ${height}"/> | ||
</geometry> | ||
</visual> | ||
</link> | ||
|
||
<joint name="inertial_joint" type="fixed"> | ||
<parent link="base_link"/> | ||
<child link="main_mass"/> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
</joint> | ||
|
||
<link name="main_mass" type="fixed"> | ||
<parent link="inertial_joint"/> | ||
<inertial> | ||
<origin xyz="0 0 0" rpy="0 0 0"/> | ||
<mass value="1000"/> | ||
<inertia | ||
ixx="166.6666" ixy="0.000000" ixz="0.000000" | ||
iyy="166.6666" iyz="0.000000" | ||
izz="166.6666"/> | ||
</inertial> | ||
</link> | ||
</robot> |