Commit cdb05ba7 authored by Paul Rouanet's avatar Paul Rouanet
Browse files

Change of the organization

parent 54a12429
cmake_minimum_required(VERSION 3.5)
project(ros2_description_bolt)
find_package(ament_cmake REQUIRED)
install(
DIRECTORY meshes ros2_control urdf launch
DESTINATION share/${PROJECT_NAME}
)
ament_package()
# Adapted from https://github.com/ros-controls/ros2_control_demos/blob/master/ros2_control_demo_description/rrbot_description/launch/view_robot.launch.py
# Copyright 2021 Stogl Robotics Consulting UG (haftungsbeschränkt)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
def generate_launch_description():
# Declare arguments
declared_arguments = []
declared_arguments.append(
DeclareLaunchArgument(
"description_package",
default_value="ros2_description_bolt",
description="Description package with robot URDF/xacro files. Usually the argument \
is not set, it enables use of a custom description.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"description_file",
default_value="system_bolt.ros2_control.xacro",
description="URDF/XACRO description file with the robot.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"prefix",
default_value='""',
description="Prefix of the joint names, useful for \
multi-robot setup. If changed than also joint names in the controllers' configuration \
have to be updated.",
)
)
# Initialize Arguments
description_package = LaunchConfiguration("description_package")
description_file = LaunchConfiguration("description_file")
prefix = LaunchConfiguration("prefix")
# Get URDF via xacro
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare(description_package), "urdf", description_file]
),
" ",
"prefix:=",
prefix,
]
)
robot_description = {"robot_description": robot_description_content}
rviz_config_file = PathJoinSubstitution(
[FindPackageShare(description_package), "config", "rrbot.rviz"]
)
joint_state_publisher_node = Node(
package="joint_state_publisher_gui",
executable="joint_state_publisher_gui",
)
robot_state_publisher_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
output="both",
parameters=[robot_description],
)
rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=["-d", rviz_config_file],
)
nodes = [
joint_state_publisher_node,
robot_state_publisher_node,
rviz_node,
]
return LaunchDescription(declared_arguments + nodes)
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>ros2_description_bolt</name>
<version>0.0.0</version>
<description>Package with URDF and description files of Bolt.</description>
<maintainer email="prouanet@laas.fr">Paul Rouanet</maintainer>
<license>Apache-2.0</license>
<buildtool_depend>ament_cmake</buildtool_depend>
<exec_depend>joint_state_publisher_gui</exec_depend>
<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>rviz2</exec_depend>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>
<!-- Adapted from bolt.urdf.xacro of ODRI (robot_properties_bolt) https://github.com/open-dynamic-robot-initiative/robot_properties_bolt/blob/master/src/robot_properties_bolt/resources/xacro/bolt.urdf.xacro -->
<?xml version="1.0" ?>
<robot name="bolt"
xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
xmlns:xacro="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface">
<xacro:property name="mesh_ext" value="stl" />
<xacro:property name="color_name" value="grey" />
<xacro:property name="color" value="0.8 0.8 0.8" />
<xacro:property name="opacity" value="1.0" />
<xacro:property name="new_leg" value="true" />
<xacro:property name="has_passive_ankle" value="false" />
<!-- Include the legs -->
<xacro:include filename="bolt.xacro"/>
<!-- Include the fully parametrized bolt -->
<xacro:bolt_full
mesh_ext="${mesh_ext}"
color_name="${color_name}"
color="${color}"
opacity="${opacity}"
new_leg="${new_leg}"
has_passive_ankle="${has_passive_ankle}"/>
</robot>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment