openarm_ros2/openarm_bimanual_bringup/launch/start_teleop.launch.py
takuya kodama 56f98bd226
Relicense to Apache License 2.0 from BSD 3-Clause License (#13)
We are standardizing our software under Apache License 2.0. This PR
replaces existing BSD 3-Clause License with Apache 2.0 in this
repository.

## About Copyright

All commits in this repository are made by Reazon Holdings, Inc.
members, so the copyright has been added as follows.
- `Copyright 2025 Reazon Holdings, Inc.`
```console
$ git shortlog -sn
    55	Thomason Zhou
    14	thomason
     5	takuya kodama
     1	Fujimoto Seiji
     1	edwin-giang
     1	toki
```

## How it was done

We added the new license header directory by directory, with each commit
covering a single directory to make review easier.
To ensure there are no missing files, we ran the following commands.

```
$ grep -RIL --exclude-dir='.git' --exclude='*.stl' "Apache License, Version 2.0" .
./openarm_bringup/README.md
./openarm_bimanual_moveit_config/README.md
./openarm_bimanual_description/urdf/openarm_bimanual.urdf
./.gitignore
./README.md
./openarm_description/urdf/openarm.urdf
./openarm_description/resource/openarm_description
```

The following files are auto-generated. 
- openarm_bimanual_description/urdf/openarm_bimanual.urdf
- openarm_description/urdf/openarm.urdf
2025-05-22 16:22:55 +09:00

101 lines
3.3 KiB
Python

# Copyright 2025 Reazon Holdings, Inc.
#
# 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.
import launch
from launch.actions import (
DeclareLaunchArgument,
IncludeLaunchDescription,
TimerAction,
RegisterEventHandler,
)
from launch.event_handlers import OnProcessStart
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution, Command
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from launch_ros.parameter_descriptions import ParameterValue
from launch.launch_description_sources import PythonLaunchDescriptionSource
import pathlib
def generate_launch_description():
pkg_share = FindPackageShare(package="openarm_bimanual_description")
xacro_path = (
pathlib.Path(pkg_share.find("openarm_bimanual_description"))
/ "urdf/openarm_bimanual.urdf.xacro"
)
use_sim_time = LaunchConfiguration("use_sim_time")
use_sim_time_launch_arg = DeclareLaunchArgument(name="use_sim_time", default_value="false")
robot_state_publisher_node = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[
PathJoinSubstitution(
[
pkg_share,
"launch",
"description.launch.py",
]
),
]
),
launch_arguments=dict(use_sim_time=use_sim_time).items(),
)
robot_description_content = Command(["xacro ", LaunchConfiguration("model")])
robot_description_param = {
"robot_description": ParameterValue(robot_description_content, value_type=str)
}
controller_params = PathJoinSubstitution(
[FindPackageShare(package="openarm_bimanual_bringup"), "config", "controllers.yaml"]
)
controller_manager = Node(
package="controller_manager",
executable="ros2_control_node",
parameters=[controller_params, robot_description_param],
)
delayed_controller_manager = TimerAction(period=3.0, actions=[controller_manager])
joint_broadcaster_spawner = Node(
package="controller_manager",
executable="spawner",
arguments=["joint_state_broad"],
)
delayed_joint_broadcaster_spawner = RegisterEventHandler(
event_handler=OnProcessStart(
target_action=controller_manager,
on_start=[joint_broadcaster_spawner],
)
)
return launch.LaunchDescription(
[
DeclareLaunchArgument(
name="model",
default_value=str(xacro_path),
description="Absolute path to the robot URDF or xacro file",
),
use_sim_time_launch_arg,
robot_state_publisher_node,
delayed_controller_manager,
delayed_joint_broadcaster_spawner,
]
)