UniversalRobots / Universal_Robots_ROS2_GZ_Simulation

BSD 3-Clause "New" or "Revised" License
27 stars 14 forks source link

Rviz crashes when planning by cartesian path #57

Open XHao1997 opened 1 week ago

XHao1997 commented 1 week ago

Screenshot from 2024-10-08 20-13-31 I can't fix it though adding use_sim_time:=true

fmauch commented 1 week ago

You can or you can't fix it adding use_sim_time:=true? Adding that seems not to be the worst idea, anyway... Where exactly did you (try?) to set it?

XHao1997 commented 1 week ago

I can't fix it by setting use_sim_time. I try setting it in ur_sim_moveit.launch.py, unfortunately, it doesn't work. The rviz will crash once it plans by cartesian path.

ur_control_launch = IncludeLaunchDescription(
    PythonLaunchDescriptionSource(
        [FindPackageShare("ur_simulation_gz"), "/launch", "/ur_sim_control.launch.py"]
    ),
    launch_arguments={
        "ur_type": ur_type,
        "safety_limits": safety_limits,
        "runtime_config_package": runtime_config_package,
        "controllers_file": controllers_file,
        "description_package": description_package,
        "description_file": description_file,
        "prefix": prefix,
        "use_sim_time": "true",
        "launch_rviz": "false",

    }.items(),
)
fmauch commented 1 week ago

Thank you for the elaboration. Th place where you added use_sim_time isn't really doing anything, as that is not an input argument of ur_sim_control.launch.py (This wouldn't make sense, since it is a simulation launch file. after all)

I can confirm that this doesn't work and leads to a crash.

I got it somehow working by passing use_sim_time = true to the MoveIt rviz instance here:

        parameters=[
            moveit_config.robot_description,
            moveit_config.robot_description_semantic,
            moveit_config.robot_description_kinematics,
            moveit_config.planning_pipelines,
            moveit_config.joint_limits,
            warehouse_ros_config,
            {
                "use_sim_time": use_sim_time,
            },

With that, I was able to plan Cartesian paths successfully. However, I cannot query the goal state with the interactive marker as soon as I add that parameter. I'm, not familiar enough with either MoveIt or GZ-Sim to understand what is going wrong here. I noticed that the /clock topic doesn't contain any message, though.

I tested the same use_sim_time adaption in Humble using Gazebo classic and there it worked correctly and helped avoiding the crash, so this is probably the right way to go.

XHao1997 commented 1 week ago

If I understand correctly, I need to download and modify the source code and then build it. Sorry, I am a beginner in ROS and I am looking forward to your reply~

fmauch commented 1 week ago

At the moment it's not as simple as that as I described above. We'll probably provide a fix soon.

fmauch commented 1 week ago

This issue should be fixed (on Rolling) by the following three PRs