My_moveit_config robot unable to load - [move_group-1] freeglut failed to open display ':0''

Was trying to work on the MoveIt examples in ROS2 Manipulation Basics and encountered this error while trying to load the created model.
The terminal says: ‘[move_group-1] freeglut failed to open display ‘:0’’. I’ve seen posts (generate_move_group_launch assumes DISPLAY=:0 · Issue #2026 · ros-planning/moveit2 · GitHub) with respect to this, but unable to do the same since the file can be edited only when installed using source.

Hello @UdhayaKumar ,

Could you try going to another course and then coming back to this one? This is to reset the environment and get rid of any strange errors that might have appeared in your specific environment.

Never seen this error before, and it’s working ok for me right now while I’m testing.

Let me know how it goes.

Best,

@albertoezquerro
I am getting the same error after building the workspace.

I get an stderr message during build, if that is relevant.

ser:~/ros2_ws$ colcon build
[14.808s] WARNING:colcon.colcon_core.package_selection:Some selected packages are already built in one or more underlay workspaces:
        'ur_description' is in: /home/user/ros2_ws/install/ur_description, /home/simulations/ros2_sims_ws/install/ur_description
If a package in a merged underlay workspace is overridden and it installs headers, then all packages in the overlay must sort their include directories by workspace order. Failure to do so may result in build failures or undefined behavior at run time.
If the overridden package is used by another package in any underlay, then the overriding package in the overlay must be API andABI compatible or undefined behavior at run time may occur.

If you understand the risks and want to override a package anyways, add the following to the command line:
        --allow-overriding ur_description

This may be promoted to an error in a future release of colcon-override-check.
Starting >>> robotiq_85_msgs
Starting >>> robotiq_85_description
Starting >>> robotnik_sensors
Starting >>> ur_description
Finished <<< robotnik_sensors [4.53s]
Starting >>> robotnik_sensors_gazebo
Finished <<< ur_description [5.10s]
Starting >>> my_moveit_config
Finished <<< robotiq_85_description [5.64s]
Finished <<< robotnik_sensors_gazebo [4.01s]
Finished <<< my_moveit_config [3.76s]
Finished <<< robotiq_85_msgs [9.83s]
Starting >>> robotiq_85_driver
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'install-scripts' will not be supported in future versions. Please use the underscore name 'install_scripts' instead
  warnings.warn(
--- stderr: robotiq_85_driver
/usr/lib/python3/dist-packages/setuptools/dist.py:723: UserWarning: Usage of dash-separated 'script-dir' will not be supported in future versions. Please use the underscore name 'script_dir' instead
  warnings.warn(
/usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
---
Finished <<< robotiq_85_driver [4.53s]
Starting >>> robotiq_85_gripper
Finished <<< robotiq_85_gripper [1.11s]

Summary: 8 packages finished [21.6s]
  1 package had stderr output: robotiq_85_driver

And here is the error given when trying to run the basic motion planning launch file:

user:~/ros2_ws$ ros2 launch my_moveit_config move_group.launch.py
[INFO] [launch]: All log files can be found below /home/user/.ros/log/2024-04-25-05-52-06-465689-2_xterm-2193
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [move_group-1]: process started with pid [2194]
[move_group-1] [INFO] [1714024327.854978203] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.108474 seconds
[move_group-1] [INFO] [1714024327.857131993] [moveit_robot_model.robot_model]: Loading robot model 'name'...
[move_group-1] [INFO] [1714024327.995400206] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Publishing maintained planning scene on 'monitored_planning_scene'
[move_group-1] [INFO] [1714024327.995995359] [moveit.ros_planning_interface.moveit_cpp]: Listening to 'joint_states' for joint states
[move_group-1] [INFO] [1714024327.997307702] [moveit_ros.current_state_monitor]: Listening to joint states on topic 'joint_states'
[move_group-1] [INFO] [1714024327.998826014] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/attached_collision_object' for attached collision objects
[move_group-1] [INFO] [1714024327.998850895] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting planning scenemonitor
[move_group-1] [INFO] [1714024327.999630881] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to '/planning_scene'
[move_group-1] [INFO] [1714024327.999652383] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Starting world geometryupdate monitor for collision objects, attached objects, octomap updates.
[move_group-1] [INFO] [1714024328.000198007] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'collision_object'
[move_group-1] [INFO] [1714024328.001007216] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Listening to 'planning_scene_world' for planning scene world geometry
[move_group-1] [WARN] [1714024328.002945596] [moveit.ros.occupancy_map_monitor.middleware_handle]: Resolution not specified for Octomap. Assuming resolution = 0.1 instead
[move_group-1] freeglut failed to open display ':0'
[ERROR] [move_group-1]: process has died [pid 2194, exit code 1, cmd '/opt/ros/humble/lib/moveit_ros_move_group/move_group --ros-args --params-file /tmp/launch_params_l330c2ac --params-file /tmp/launch_params_s7forph6'].

Hi @pbnpama ,

I was just doing some tests with your setup. You have to update your move_group.launch.py with the following contents, as indicated in the notebook:

from moveit_configs_utils import MoveItConfigsBuilder
from moveit_configs_utils.launches import generate_move_group_launch

from launch import LaunchDescription
from launch_ros.actions import Node

def generate_launch_description():
    moveit_config = MoveItConfigsBuilder("name", package_name="my_moveit_config").to_moveit_configs()
    
    # Move Group Node
    move_group_node = Node(
        package="moveit_ros_move_group",
        executable="move_group",
        output="screen",
        parameters=[
            moveit_config.to_dict(),
            {"trajectory_execution.allowed_execution_duration_scaling": 2.0,},
            {"publish_robot_description_semantic": True},
            {"use_sim_time": True},
        ],
    )

    return LaunchDescription(
        [move_group_node]
    )

After updating this file and re-building your ros2_ws, the program should launch correctly.

Best,

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.