Skip to content

Commit

Permalink
Fixed namespaces and updated ros_component_description (#424)
Browse files Browse the repository at this point in the history
* Fixed namespaces and updated ros_component_description

Signed-off-by: Jakub Delicat <[email protected]>

* Remove panther_version

---------

Signed-off-by: Jakub Delicat <[email protected]>
Co-authored-by: rafal-gorecki <[email protected]>
  • Loading branch information
delihus and rafal-gorecki authored Oct 10, 2024
1 parent c790c53 commit 863ef77
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 15 deletions.
2 changes: 1 addition & 1 deletion panther/panther_hardware.repos
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories:
ros_components_description:
type: git
url: https://github.com/husarion/ros_components_description.git
version: b29f5637a243b0008ac197032575c8df47883b2c
version: 99e0189970293bb0110aad0a3b609bc659ecc663
ros2_controllers: # Caused by two error: 1. https://github.com/ros-controls/ros2_controllers/pull/1104 2. There is no nice way to change `sensor_name` imu_bradcaster param when spawning multiple robots -> ros2_control refer only to single imu entity
type: git
url: https://github.com/husarion/ros2_controllers/
Expand Down
2 changes: 1 addition & 1 deletion panther/panther_simulation.repos
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repositories:
ros_components_description:
type: git
url: https://github.com/husarion/ros_components_description.git
version: b29f5637a243b0008ac197032575c8df47883b2c
version: 99e0189970293bb0110aad0a3b609bc659ecc663
ros2_controllers: # Caused by two error: 1. https://github.com/ros-controls/ros2_controllers/pull/1104 2. There is no nice way to change `sensor_name` imu_bradcaster param when spawning multiple robots -> ros2_control refer only to single imu entity
type: git
url: https://github.com/husarion/ros2_controllers/
Expand Down
1 change: 0 additions & 1 deletion panther_docking/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ The package contains a `PantherChargingDock` plugin for the [opennav_docking](ht

#### Parameters

- `~panther_version` [*double*, default: **1.21**]: A version of Panther robot.
- `~<dock_name>.base_frame` [*string*, default: **base_link**]: A base frame id of a robot.
- `~<dock_name>.external_detection_timeout` [*double*, default: **0.2**]: A timeout in seconds for looking up a transformation from an april tag of a dock to a base frame id.
- `~<dock_name>.external_detection_translation_x` [*double*, default: **0.0**]: A translation over an X axis between a detected frame and a dock pose.
Expand Down
2 changes: 1 addition & 1 deletion panther_docking/config/panther_docking_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
docks: ["main_dock"]
main_dock:
type: panther_charging_dock
frame: <robot_namespace>/wibotic_station_link
frame: <robot_namespace>/main_wibotic_station_link
pose: [0.0, 0.0, 0.0] # position of the dock device (not the staging position), the front (X+) of the dock should point away from the robot

controller:
Expand Down
5 changes: 1 addition & 4 deletions panther_docking/launch/docking.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@


def generate_launch_description():
panther_version = EnvironmentVariable(name="PANTHER_ROBOT_VERSION", default_value="1.0")

use_sim = LaunchConfiguration("use_sim")
declare_use_sim_arg = DeclareLaunchArgument(
"use_sim",
Expand Down Expand Up @@ -61,9 +59,8 @@ def generate_launch_description():
package="opennav_docking",
executable="opennav_docking",
parameters=[
{"panther_version": panther_version},
namespaced_docking_server_config,
{"use_sim_time": True},
{"use_sim_time": use_sim},
],
namespace=namespace,
emulate_tty=True,
Expand Down
13 changes: 9 additions & 4 deletions panther_docking/launch/station.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
PythonExpression,
)
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue
from launch_ros.substitutions import FindPackageShare
from moms_apriltag import TagGenerator2

Expand All @@ -41,7 +42,7 @@ def generate_apriltag_and_get_path(tag_id):


def launch_setup(context, *args, **kwargs):
namespace = LaunchConfiguration("namespace")
namespace = LaunchConfiguration("namespace").perform(context)
apriltag_id = int(LaunchConfiguration("apriltag_id").perform(context))
apriltag_size = LaunchConfiguration("apriltag_size").perform(context)

Expand All @@ -58,8 +59,8 @@ def launch_setup(context, *args, **kwargs):
"wibotic_station.urdf.xacro",
]
),
" namespace:=",
namespace,
" device_namespace:=",
"main",
" apriltag_image_path:=",
apriltag_image_path,
" apriltag_size:=",
Expand All @@ -69,12 +70,16 @@ def launch_setup(context, *args, **kwargs):

namespace_ext = PythonExpression(["'", namespace, "' + '/' if '", namespace, "' else ''"])

station_description = {
"robot_description": ParameterValue(station_description_content, value_type=str)
}

station_state_pub_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
name="wibotic_station_state_publisher",
parameters=[
{"robot_description": station_description_content},
station_description,
{"frame_prefix": namespace_ext},
],
remappings=[("robot_description", "station_description")],
Expand Down
3 changes: 0 additions & 3 deletions panther_docking/src/panther_charging_dock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ void PantherChargingDock::deactivate()

void PantherChargingDock::declareParameters(const rclcpp_lifecycle::LifecycleNode::SharedPtr & node)
{
nav2_util::declare_parameter_if_not_declared(
node, "panther_version", rclcpp::ParameterValue(1.0));

nav2_util::declare_parameter_if_not_declared(
node, name_ + ".base_frame", rclcpp::ParameterValue("base_link"));
nav2_util::declare_parameter_if_not_declared(
Expand Down

0 comments on commit 863ef77

Please sign in to comment.