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

RViz ignores 'joint_limits.yaml' in MoveIt Config when using moveit_rviz default launch file #2989

Closed
Dabuss opened this issue Sep 3, 2024 · 3 comments

Comments

@Dabuss
Copy link

Dabuss commented Sep 3, 2024

Description:

I encountered an issue where RViz ignores the joint limits specified in the joint_limits.yaml file within the MoveIt configuration package when launching using the default launch files generated by the MoveIt2 Setup Assistant.

Steps to Reproduce:

(On branch humble)

  • Create a MoveIt2 configuration package using the Setup Assistant.
  • Define custom joint limits in the joint_limits.yaml file within the config directory.
  • Notice how these joint_limits are ignored by looking at rviz parameters

Observed Behavior:

In my case, Motion planning within RViz results in unexpectedly large joint movements. Upon further inspection, it appears that RViz is using the same joint limits as in the URDF (in my case, a UR10e robot with 720° angle ranges), rather than the limits specified in joint_limits.yaml present in the moveit_config of my robot package.
My move_group node (whose launch file was also created with the setup assistant), however, uses the values from the local joint_limit.yaml file.

Expected Behavior:

I believe the RViz motion planning plugin should use the same joint limits as the move_group's when performing motion planning.

My Solution:

I modified the generate_moveit_rviz_launch function to include the joint limits in the node parameters passed to RViz. Here is the reimplementation of the function:

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from moveit_configs_utils import MoveItConfigsBuilder

def generate_moveit_rviz_launch_using_joint_limits(moveit_config):
    ld = LaunchDescription()

    ld.add_action(DeclareBooleanLaunchArg("debug", default_value=False))
    ld.add_action(
        DeclareLaunchArgument(
            "rviz_config",
            default_value=str(moveit_config.package_path / "config/moveit.rviz"),
        )
    )

    rviz_parameters = [
        moveit_config.planning_pipelines,
        moveit_config.robot_description_kinematics,
        moveit_config.robot_description_joint_limits  # Added joint limits here
    ]

    add_debuggable_node(
        ld,
        package="rviz2",
        executable="rviz2",
        output="log",
        respawn=False,
        arguments=["-d", LaunchConfiguration("rviz_config")],
        parameters=rviz_parameters,
    )

    return ld

Question:

Is this behavior intentional, or is it an oversight that RViz does not use the joint limits from joint_limits.yaml? Should the default generate_moveit_rviz_launch function be updated to include these limits, or is there another recommended approach?

Thank you for your assistance!

Copy link

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

@github-actions github-actions bot added the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Oct 18, 2024
@m-elwin
Copy link
Contributor

m-elwin commented Nov 14, 2024

I was having this same issue and created a PR #3901. My solution was basically the same as @Dabuss although it seems like robot_description_joint_limits became just joint_limits at some point.

@github-actions github-actions bot removed the stale Inactive issues and PRs are marked as stale and may be closed automatically. label Nov 15, 2024
@mikeferguson
Copy link
Contributor

This is fixed in main - I just started the back port to humble in #3136

@github-project-automation github-project-automation bot moved this to ✅ Done in MoveIt Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants