Skip to content

Commit

Permalink
Added keyboard server to sm_multi_panda
Browse files Browse the repository at this point in the history
  • Loading branch information
brettpac committed Sep 27, 2024
1 parent a30de33 commit 40c0cce
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2021 RobosoftAI 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 os
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, OpaqueFunction
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
from ament_index_python.packages import get_package_share_directory
from moveit_configs_utils import MoveItConfigsBuilder


def generate_launch_description():

declared_arguments = []
declared_arguments.append(
DeclareLaunchArgument(
"rviz_config",
default_value="panda_moveit_config_demo.rviz",
description="RViz configuration file",
)
)

return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup)])


def launch_setup(context, *args, **kwargs):

keyboard_client_node = Node(
package="keyboard_client",
executable="keyboard_server_node.py",
name="keyboard_client",
output="screen",
prefix="xterm -hold -e",
arguments=["--ros-args", "--log-level", "INFO"],
)

nodes_to_start = [
keyboard_client_node,
]

return nodes_to_start
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,14 @@ def generate_launch_description():
)
)

return LaunchDescription([panda_arm_1, panda_arm_2])
keyboard_server = IncludeLaunchDescription(
AnyLaunchDescriptionSource(
os.path.join(
get_package_share_directory("sm_multi_panda_sim"),
"launch",
"keyboard_server.launch.py",
)
)
)

return LaunchDescription([panda_arm_1, panda_arm_2, keyboard_server])
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
joint_states:
panda_finger_joint1: 0.03
panda_finger_joint2: 0.03

0 comments on commit 40c0cce

Please sign in to comment.