Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ROBOT_NAMESPACE env #23

Merged
merged 3 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ The robot can be operated at 3 scales of speed depending on pressed buttons. It'
- `regular` *(float, default: 0.5)*
- `slow` *(float, default: 0.2)*

The node can be configured using parameters described below to work with robots equipped with an E-stop interface. An example configuration for a robot with an E-stop interface can be found in [panther config file](./joy2twist/config/joy2twist_panther.yaml).
The node can be configured using parameters described below to work with robots equipped with an E-stop interface. An example configuration for a robot with an E-stop interface can be found in [panther config file](./joy2twist/config/joy2twist_ugv.yaml).

- `~e_stop/present` *(bool, default: false)*
- `~e_stop/topic` *(string, default: e_stop)*
Expand Down
4 changes: 2 additions & 2 deletions demo/single_robot/compose.panther.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ services:
devices:
- /dev/input/js0
volumes:
- ./../../joy2twist/config/joy2twist_panther.yaml:/joy2twist_panther.yaml
- ./../../joy2twist/config/joy2twist_ugv.yaml:/joy2twist_ugv.yaml
command: >
ros2 launch joy2twist gamepad_controller.launch.py
joy2twist_params_file:=/joy2twist_panther.yaml
joy2twist_params_file:=/joy2twist_ugv.yaml
7 changes: 3 additions & 4 deletions joy2twist/launch/gamepad_controller.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution


def generate_launch_description():
namespace = LaunchConfiguration("namespace")
declare_namespace_arg = DeclareLaunchArgument(
"namespace",
default_value="",
description="Namespace for all topics and tfs",
default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""),
description="Add namespace to all launched nodes.",
)

joy2twist_cfg_path = PathJoinSubstitution(
Expand Down Expand Up @@ -42,7 +42,6 @@ def generate_launch_description():
joy_linux_node = Node(
package="joy_linux",
executable="joy_linux_node",
# output={"stdout": "screen", "stderr": "screen"},
emulate_tty="true",
namespace=namespace,
remappings=[("/diagnostics", "diagnostics")],
Expand Down
7 changes: 3 additions & 4 deletions joy2twist/launch/joy2twist.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch.substitutions import EnvironmentVariable, LaunchConfiguration, PathJoinSubstitution


def generate_launch_description():
namespace = LaunchConfiguration("namespace")
declare_namespace_arg = DeclareLaunchArgument(
"namespace",
default_value="",
description="Namespace for all topics and tfs",
default_value=EnvironmentVariable("ROBOT_NAMESPACE", default_value=""),
description="Add namespace to all launched nodes.",
)

joy2twist_cfg_path = PathJoinSubstitution(
Expand All @@ -28,7 +28,6 @@ def generate_launch_description():
package="joy2twist",
executable="joy2twist",
parameters=[LaunchConfiguration("joy2twist_params_file")],
# output={"stdout": "screen", "stderr": "screen"},
emulate_tty="true",
namespace=namespace,
)
Expand Down
Loading