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

action_ns is improperly named #3384

Open
jimmy-mcelwain opened this issue Mar 18, 2025 · 1 comment
Open

action_ns is improperly named #3384

jimmy-mcelwain opened this issue Mar 18, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@jimmy-mcelwain
Copy link

Description

I believe that action_ns from the moveit_controllers.yaml is improperly named. Maybe controller_names too. Specifically, according to this ROS2 design document, a relative action name should be /name/space/action/name/[hidden], so namespace followed by action name followed by the hidden services and topics. Note that in every example, "action name" is required directly before the hidden service and topics part. But in moveit_controllers.yaml, action_ns does not actually change the namespace, but the action name itself. And it seems like the value of controller_names comes before action_ns, which means it is where I would expect the namespace to be. It's just a bit confusing. How should I think about controller_names and action_ns in terms of namespace vs action name?

For reference, I believe that the part causing this behavior is here

std::string getActionName() const
{
if (namespace_.empty())
{
return name_;
}
else
{
return name_ + "/" + namespace_;
}
}

ROS Distro

Humble

OS and version

Ubuntu 22.04

Source or binary build?

Source

If binary, which release version?

No response

If source, which branch?

No response

Which RMW are you using?

None

Steps to Reproduce

Set both action_ns and controller_names in moveit_controllers.yaml and launch a moveit instance with that.

Expected behavior

action_ns should modify the namespace, not the action name itself.

Actual behavior

action_ns modifies the name directly before the hidden portion, meaning it is modifying the action name rather than the namespace.

Backtrace or Console output

No response

@jimmy-mcelwain jimmy-mcelwain added the bug Something isn't working label Mar 18, 2025
@zacharyyamaoka
Copy link

Potentially related...

I edited this file https://github.com/moveit/moveit2/blob/main/moveit_ros/planning/trajectory_execution_manager/src/trajectory_execution_manager.cpp

to give the option to set the namespace for a controller manager. Its working well for me right now...

 // Around line 157
  if (!controller.empty())
    {
      try
      {
        // We make a node called moveit_simple_controller_manager so it's able to
        // receive callbacks on another thread. We then copy parameters from the move_group node
        // and then add it to the multithreadedexecutor
        rclcpp::NodeOptions opt;
        opt.allow_undeclared_parameters(true);
        opt.automatically_declare_parameters_from_overrides(true);

        std::string controller_manager_ns = "";
        if (node_->get_parameter("controller_manager_ns", controller_manager_ns)){
          RCLCPP_INFO_STREAM(logger_, "Using namespace for moveit controller manager");
        }

So my moveit_controllers.yaml now looks like:

moveit_controller_manager: moveit_simple_controller_manager/MoveItSimpleControllerManager
controller_manager_ns: bam_BAMGPU

moveit_simple_controller_manager:
  controller_names:
    - right_arm_trajectory_controller

  right_arm_trajectory_controller:
    type: FollowJointTrajectory
    action_ns: follow_joint_trajectory
    default: true
    joints:
      - right_joint_1
      - right_joint_2
      - right_joint_3
      - right_joint_4
      - right_joint_5
      - right_joint_6

And my system setup is like this:

bam-gpu@bam-gpu:~$ ros2 topic list
/bam_BAMGPU/attached_collision_object
/bam_BAMGPU/collision_object
/bam_BAMGPU/display_contacts
/bam_BAMGPU/display_planned_path
/bam_BAMGPU/dynamic_joint_states
/bam_BAMGPU/joint_state_broadcaster/transition_event
/bam_BAMGPU/joint_states
/bam_BAMGPU/monitored_planning_scene
/bam_BAMGPU/pipeline_state
/bam_BAMGPU/planning_scene
/bam_BAMGPU/planning_scene_world
/bam_BAMGPU/recognized_object_array
/bam_BAMGPU/right_arm_position_controller/commands
/bam_BAMGPU/right_arm_position_controller/transition_event
/bam_BAMGPU/right_arm_trajectory_controller/controller_state
/bam_BAMGPU/right_arm_trajectory_controller/joint_trajectory
/bam_BAMGPU/right_arm_trajectory_controller/transition_event
/bam_BAMGPU/right_eef_controller/transition_event
/bam_BAMGPU/right_joint_1_moteus_controller/commands
/bam_BAMGPU/right_joint_1_moteus_controller/transition_event
/bam_BAMGPU/right_joint_2_moteus_controller/commands
/bam_BAMGPU/right_joint_2_moteus_controller/transition_event
/bam_BAMGPU/right_joint_3_moteus_controller/commands
/bam_BAMGPU/right_joint_3_moteus_controller/transition_event
/bam_BAMGPU/right_joint_4_moteus_controller/commands
/bam_BAMGPU/right_joint_4_moteus_controller/transition_event
/bam_BAMGPU/right_joint_5_moteus_controller/commands
/bam_BAMGPU/right_joint_5_moteus_controller/transition_event
/bam_BAMGPU/right_joint_6_moteus_controller/commands
/bam_BAMGPU/right_joint_6_moteus_controller/transition_event
/bam_BAMGPU/right_joint_7_moteus_controller/commands
/bam_BAMGPU/right_joint_7_moteus_controller/transition_event
/bam_BAMGPU/right_joint_upper_arm_c1_moteus_controller/commands
/bam_BAMGPU/right_joint_upper_arm_c1_moteus_controller/transition_event
/bam_BAMGPU/robot_description
/bam_BAMGPU/robot_description_semantic
/bam_BAMGPU/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/feedback
/bam_BAMGPU/rviz_moveit_motion_planning_display/robot_interaction_interactive_marker_topic/update
/bam_BAMGPU/tf
/bam_BAMGPU/tf_static
/bam_BAMGPU/trajectory_execution_event
/clicked_point
/diagnostics
/initialpose
/move_base_simple/goal
/parameter_events
/rosout
/tf
/tf_static
bam-gpu@bam-gpu:~$ ros2 node list
WARNING: Be aware that there are nodes in the graph that share an exact name, which can have unintended side effects.
/bam_BAMGPU/controller_manager
/bam_BAMGPU/interactive_marker_display_99551756927040
/bam_BAMGPU/joint_state_broadcaster
/bam_BAMGPU/move_group
/bam_BAMGPU/move_group_private_104945004256752
/bam_BAMGPU/moveit
/bam_BAMGPU/moveit_2693129795
/bam_BAMGPU/moveit_simple_controller_manager
/bam_BAMGPU/right_arm_position_controller
/bam_BAMGPU/right_arm_trajectory_controller
/bam_BAMGPU/right_eef_controller
/bam_BAMGPU/right_joint_1_moteus_controller
/bam_BAMGPU/right_joint_2_moteus_controller
/bam_BAMGPU/right_joint_3_moteus_controller
/bam_BAMGPU/right_joint_4_moteus_controller
/bam_BAMGPU/right_joint_5_moteus_controller
/bam_BAMGPU/right_joint_6_moteus_controller
/bam_BAMGPU/right_joint_7_moteus_controller
/bam_BAMGPU/right_joint_upper_arm_c1_moteus_controller
/bam_BAMGPU/robot_state_publisher
/bam_BAMGPU/rviz2
/bam_BAMGPU/rviz2
/bam_BAMGPU/rviz2_private_123460875057952
/bam_BAMGPU/sensorless_homing
/bam_BAMGPU/tf_buffer
/bam_BAMGPU/transform_listener_impl_5a8ab2b86e00
/bam_BAMGPU/transform_listener_impl_5a8ab2c7e2a0
/bam_BAMGPU/transform_listener_impl_5f72697d4ca0
/bam_BAMGPU/transform_listener_impl_7049782cf7e0
/bam_BAMGPU/transform_listener_impl_7ffd455cde60
/foxglove_bridge
/foxglove_bridge_component_manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants