Skip to content

Commit 80e4862

Browse files
committed
Create common_xacro package and move shareable parts
1 parent a7e6f2d commit 80e4862

File tree

9 files changed

+65
-9
lines changed

9 files changed

+65
-9
lines changed

common_xacro/CMakeLists.txt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required(VERSION 3.8)
2+
project(common_xacro)
3+
4+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
5+
add_compile_options(-Wall -Wextra -Wpedantic)
6+
endif()
7+
8+
# find dependencies
9+
find_package(ament_cmake REQUIRED)
10+
# uncomment the following section in order to fill in
11+
# further dependencies manually.
12+
# find_package(<dependency> REQUIRED)
13+
14+
install(
15+
DIRECTORY urdf
16+
DESTINATION share/${PROJECT_NAME}
17+
)
18+
19+
if(BUILD_TESTING)
20+
find_package(ament_lint_auto REQUIRED)
21+
# the following line skips the linter which checks for copyrights
22+
# comment the line when a copyright and license is added to all source files
23+
set(ament_cmake_copyright_FOUND TRUE)
24+
# the following line skips cpplint (only works in a git repo)
25+
# comment the line when this package is in a git repo and when
26+
# a copyright and license is added to all source files
27+
set(ament_cmake_cpplint_FOUND TRUE)
28+
ament_lint_auto_find_test_dependencies()
29+
endif()
30+
31+
ament_package()

common_xacro/package.xml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>common_xacro</name>
5+
<version>1.0.0</version>
6+
<description>ARV Common Xacro Files</description>
7+
<maintainer email="[email protected]">Ryan Liao</maintainer>
8+
<license>MIT</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
<exec_depend>joint_state_publisher</exec_depend>
12+
<exec_depend>joint_state_publisher_gui</exec_depend>
13+
<exec_depend>robot_state_publisher</exec_depend>
14+
<exec_depend>rviz2</exec_depend>
15+
<exec_depend>xacro</exec_depend>
16+
<exec_depend>gazebo_ros_pkgs</exec_depend>
17+
<exec_depend>rclcpp</exec_depend>
18+
19+
<test_depend>ament_lint_auto</test_depend>
20+
<test_depend>ament_lint_common</test_depend>
21+
22+
<export>
23+
<build_type>ament_cmake</build_type>
24+
</export>
25+
</package>

marvin_simulation/urdf/depth_camera.xacro renamed to common_xacro/urdf/sensor/depth_camera.xacro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="depth_camera">
1616
<xacro:macro name="depth_camera" params="name mass length width height parent:=base_link *joint_origin">
1717
<!-- Includes -->
18-
<xacro:include filename="$(find marvin_simulation)/urdf/inertia.xacro"/>
18+
<xacro:include filename="$(find common_xacro)/urdf/physics/inertia.xacro"/>
1919

2020
<!-- Depth camera base link -->
2121
<link name="${name}_base_link" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="caster">
1616
<xacro:macro name="imu" params="name mass length width height parent:=base_link *joint_origin">
1717
<!-- Includes -->
18-
<xacro:include filename="$(find marvin_simulation)/urdf/inertia.xacro"/>
18+
<xacro:include filename="$(find common_xacro)/urdf/physics/inertia.xacro"/>
1919

2020
<!-- Imu base link -->
2121
<link name="${name}_base_link" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="caster">
1313
<xacro:macro name="caster" params="name mass radius parent:=base_link *joint_origin">
1414
<!-- Includes -->
15-
<xacro:include filename="$(find marvin_simulation)/urdf/inertia.xacro"/>
15+
<xacro:include filename="$(find common_xacro)/urdf/physics/inertia.xacro"/>
1616

1717
<!-- Caster link -->
1818
<link name="${name}_link">
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="wheel">
1414
<xacro:macro name="wheel" params="name mass radius width parent:=base_link *joint_origin">
1515
<!-- Includes -->
16-
<xacro:include filename="$(find marvin_simulation)/urdf/inertia.xacro"/>
16+
<xacro:include filename="$(find common_xacro)/urdf/physics/inertia.xacro"/>
1717

1818
<!-- Wheel link -->
1919
<link name="${name}_link">

marvin_simulation/urdf/chassis.xacro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<robot xmlns:xacro="http://ros.org/wiki/xacro" name="chassis">
44
<!-- Includes -->
5-
<xacro:include filename="$(find marvin_simulation)/urdf/inertia.xacro"/>
5+
<xacro:include filename="$(find common_xacro)/urdf/physics/inertia.xacro"/>
66
<xacro:include filename="$(find marvin_simulation)/urdf/constants.xacro"/>
77

88
<!-- Chassis link -->

marvin_simulation/urdf/marvin.xacro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323

2424

2525
<!-- Caster -->
26-
<xacro:include filename="$(find marvin_simulation)/urdf/caster.xacro"/>
26+
<xacro:include filename="$(find common_xacro)/urdf/wheel/caster.xacro"/>
2727
<xacro:caster name="caster" mass="${caster_mass}" radius="${caster_radius}">
2828
<origin xyz="${caster_x_offset} 0 ${caster_radius-chassis_z_offset}" rpy="0 0 0" />
2929
</xacro:caster>
3030

3131

3232
<!-- Wheels -->
33-
<xacro:include filename="$(find marvin_simulation)/urdf/wheel.xacro"/>
33+
<xacro:include filename="$(find common_xacro)/urdf/wheel/wheel.xacro"/>
3434
<xacro:wheel name="right_wheel" mass="${wheel_mass}" radius="${wheel_radius}" width="${wheel_width}">
3535
<origin xyz="0 -${track_width / 2} ${wheel_radius-chassis_z_offset}" rpy="0 0 0" />
3636
</xacro:wheel>
@@ -40,7 +40,7 @@
4040

4141

4242
<!-- Camera -->
43-
<xacro:include filename="$(find marvin_simulation)/urdf/depth_camera.xacro" />
43+
<xacro:include filename="$(find common_xacro)/urdf/sensor/depth_camera.xacro" />
4444
<xacro:depth_camera name="zed" mass="${camera_mass}" length = "${camera_length}" width="${camera_width}" height="${camera_height}" parent="base_link">
4545
<origin xyz="${camera_x_offset} 0 ${camera_z_offset}" rpy="0 ${camera_angle} 0" />
4646
</xacro:depth_camera>
@@ -54,7 +54,7 @@
5454

5555

5656
<!-- IMU -->
57-
<xacro:include filename="$(find marvin_simulation)/urdf/imu.xacro" />
57+
<xacro:include filename="$(find common_xacro)/urdf/sensor/imu.xacro" />
5858
<xacro:imu name="imu" mass="${imu_mass}" length="${imu_length}" width="${imu_width}" height="${imu_height}">
5959
<origin xyz="${-chassis_tower_length / 2 - chassis_electrical_length/2} 0 ${chassis_electrical_height}" rpy="0 0 0" />
6060
</xacro:imu>

0 commit comments

Comments
 (0)