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

Move group diying #3021

Open
t-glez opened this issue Oct 8, 2024 · 3 comments
Open

Move group diying #3021

t-glez opened this issue Oct 8, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@t-glez
Copy link

t-glez commented Oct 8, 2024

Description

I am using ROS2 to control a UR5e with the UR_ROS2_Drivers. It works when using the binary release. When using the source built version move group dies.

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?

Main

Which RMW are you using?

CycloneDDS

Steps to Reproduce

Code for calling the move_group node

"""
# Initialize Arguments
ur_type = LaunchConfiguration("ur_type")
use_fake_hardware = LaunchConfiguration("use_fake_hardware")
safety_limits = LaunchConfiguration("safety_limits")
safety_pos_margin = LaunchConfiguration("safety_pos_margin")
safety_k_position = LaunchConfiguration("safety_k_position")
# General arguments
description_package = LaunchConfiguration("description_package")
description_file = LaunchConfiguration("description_file")
_publish_robot_description_semantic = LaunchConfiguration("publish_robot_description_semantic")
moveit_config_package = LaunchConfiguration("moveit_config_package")
moveit_joint_limits_file = LaunchConfiguration("moveit_joint_limits_file")
moveit_config_file = LaunchConfiguration("moveit_config_file")
warehouse_sqlite_path = LaunchConfiguration("warehouse_sqlite_path")
prefix = LaunchConfiguration("prefix")
use_sim_time = LaunchConfiguration("use_sim_time")
launch_rviz = LaunchConfiguration("launch_rviz")
launch_servo = LaunchConfiguration("launch_servo")

joint_limit_params = PathJoinSubstitution(
    [FindPackageShare(description_package), "config", ur_type, "joint_limits.yaml"]
)
kinematics_params = PathJoinSubstitution(
    [FindPackageShare(description_package), "config", ur_type, "default_kinematics.yaml"]
)
physical_params = PathJoinSubstitution(
    [FindPackageShare(description_package), "config", ur_type, "physical_parameters.yaml"]
)
visual_params = PathJoinSubstitution(
    [FindPackageShare(description_package), "config", ur_type, "visual_parameters.yaml"]
)

robot_description_content = Command(
    [
        PathJoinSubstitution([FindExecutable(name="xacro")]),
        " ",
        PathJoinSubstitution([FindPackageShare(description_package), "urdf", description_file]),
        " ",
        "robot_ip:=xxx.yyy.zzz.www",
        " ",
        "joint_limit_params:=",
        joint_limit_params,
        " ",
        "kinematics_params:=",
        kinematics_params,
        " ",
        "physical_params:=",
        physical_params,
        " ",
        "visual_params:=",
        visual_params,
        " ",
        "safety_limits:=",
        safety_limits,
        " ",
        "safety_pos_margin:=",
        safety_pos_margin,
        " ",
        "safety_k_position:=",
        safety_k_position,
        " ",
        "name:=",
        "ur",
        " ",
        "ur_type:=",
        ur_type,
        " ",
        "script_filename:=ros_control.urscript",
        " ",
        "input_recipe_filename:=rtde_input_recipe.txt",
        " ",
        "output_recipe_filename:=rtde_output_recipe.txt",
        " ",
        "prefix:=",
        prefix,
        " ",
    ]
)
robot_description = {"robot_description": robot_description_content}

# MoveIt Configuration
robot_description_semantic_content = Command(
    [
        PathJoinSubstitution([FindExecutable(name="xacro")]),
        " ",
        PathJoinSubstitution(
            [FindPackageShare(moveit_config_package), "srdf", moveit_config_file]
        ),
        " ",
        "name:=",
        # Also ur_type parameter could be used but then the planning group names in yaml
        # configs has to be updated!
        "ur",
        " ",
        "prefix:=",
        prefix,
        " ",
    ]
)
robot_description_semantic = {"robot_description_semantic": robot_description_semantic_content}

publish_robot_description_semantic = {
    "publish_robot_description_semantic": _publish_robot_description_semantic
}

robot_description_kinematics = PathJoinSubstitution(
    [FindPackageShare(moveit_config_package), "config", "kinematics.yaml"]
)

robot_description_planning = {
    "robot_description_planning": load_yaml(
        str(moveit_config_package.perform(context)),
        os.path.join("config", str(moveit_joint_limits_file.perform(context))),
    )
}

# Planning Configuration
ompl_planning_pipeline_config = {
    "move_group": {
        "planning_plugin": "ompl_interface/OMPLPlanner",
        "request_adapters": """default_planner_request_adapters/AddTimeOptimalParameterization default_planner_request_adapters/FixWorkspaceBounds default_planner_request_adapters/FixStartStateBounds default_planner_request_adapters/FixStartStateCollision default_planner_request_adapters/FixStartStatePathConstraints""",
        "start_state_max_bounds_error": 0.1,
    }
}
ompl_planning_yaml = load_yaml("ur_moveit_config", "config/chomp_planning.yaml")
ompl_planning_pipeline_config["move_group"].update(ompl_planning_yaml)

# Trajectory Execution Configuration
controllers_yaml = load_yaml("ur_moveit_config", "config/controllers.yaml")
# the scaled_joint_trajectory_controller does not work on fake hardware
change_controllers = context.perform_substitution(use_fake_hardware)
if change_controllers == "true":
    controllers_yaml["scaled_joint_trajectory_controller"]["default"] = False
    controllers_yaml["joint_trajectory_controller"]["default"] = True

moveit_controllers = {
    "moveit_simple_controller_manager": controllers_yaml,
    "moveit_controller_manager": "moveit_simple_controller_manager/MoveItSimpleControllerManager",
}

trajectory_execution = {
    "moveit_manage_controllers": False,
    "trajectory_execution.allowed_execution_duration_scaling": 1.2,
    "trajectory_execution.allowed_goal_duration_margin": 0.5,
    "trajectory_execution.allowed_start_tolerance": 0.01,
}

planning_scene_monitor_parameters = {
    "publish_planning_scene": True,
    "publish_geometry_updates": True,
    "publish_state_updates": True,
    "publish_transforms_updates": True,
}

warehouse_ros_config = {
    "warehouse_plugin": "warehouse_ros_sqlite::DatabaseConnection",
    "warehouse_host": warehouse_sqlite_path,
}
octomap_config = {
    'octomap_frame':'camera1_depth_optical_frame',
    'octomap_resolution':0.05,
    'max_range':5
}
octomap_updater_config = load_yaml("ur_moveit_config", "config/sensors_kinect_pointcloud.yaml")
# Start the actual move_group node/action server
move_group_node = Node(
    package="moveit_ros_move_group",
    executable="move_group",
    output="screen",
    parameters=[
        robot_description,
        robot_description_semantic,
        publish_robot_description_semantic,
        robot_description_kinematics,
        robot_description_planning,
        ompl_planning_pipeline_config,
        trajectory_execution,
        moveit_controllers,
        planning_scene_monitor_parameters,
        {"use_sim_time": use_sim_time},
        warehouse_ros_config,
        octomap_config,
        octomap_updater_config
    ],
)

# rviz with moveit configuration
rviz_config_file = PathJoinSubstitution(
    [FindPackageShare(moveit_config_package), "rviz", "view_robot.rviz"]
)
rviz_node = Node(
    package="rviz2",
    condition=IfCondition(launch_rviz),
    executable="rviz2",
    name="rviz2_moveit",
    output="log",
    arguments=["-d", rviz_config_file],
    parameters=[
        robot_description,
        robot_description_semantic,
        ompl_planning_pipeline_config,
        robot_description_kinematics,
        robot_description_planning,
        warehouse_ros_config,
    ],
)

# Servo node for realtime control
servo_yaml = load_yaml("ur_moveit_config", "config/ur_servo.yaml")
servo_params = {"moveit_servo": servo_yaml}
servo_node = Node(
    package="moveit_servo",
    condition=IfCondition(launch_servo),
    executable="servo_node",
    parameters=[
        servo_params,
        robot_description,
        robot_description_semantic,
    ],
    output="screen",
)

nodes_to_start = [move_group_node, rviz_node, servo_node]

return nodes_to_start

def generate_launch_description():

declared_arguments = []
# UR specific arguments
declared_arguments.append(
    DeclareLaunchArgument(
        "ur_type",
        description="Type/series of used UR robot.",
        choices=["ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e", "ur20", "ur30"],
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "use_fake_hardware",
        default_value="false",
        description="Indicate whether robot is running with fake hardware mirroring command to its states.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "safety_limits",
        default_value="true",
        description="Enables the safety limits controller if true.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "safety_pos_margin",
        default_value="0.15",
        description="The margin to lower and upper limits in the safety controller.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "safety_k_position",
        default_value="20",
        description="k-position factor in the safety controller.",
    )
)
# General arguments
declared_arguments.append(
    DeclareLaunchArgument(
        "description_package",
        default_value="ur_description",
        description="Description package with robot URDF/XACRO files. Usually the argument "
        "is not set, it enables use of a custom description.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "description_file",
        default_value="ur.urdf.xacro",
        description="URDF/XACRO description file with the robot.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "publish_robot_description_semantic",
        default_value="True",
        description="Whether to publish the SRDF description on topic /robot_description_semantic.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "moveit_config_package",
        default_value="ur_moveit_config",
        description="MoveIt config package with robot SRDF/XACRO files. Usually the argument "
        "is not set, it enables use of a custom moveit config.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "moveit_config_file",
        default_value="ur.srdf.xacro",
        description="MoveIt SRDF/XACRO description file with the robot.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "moveit_joint_limits_file",
        default_value="joint_limits.yaml",
        description="MoveIt joint limits that augment or override the values from the URDF robot_description.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "warehouse_sqlite_path",
        default_value=os.path.expanduser("~/.ros/warehouse_ros.sqlite"),
        description="Path where the warehouse database should be stored",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "use_sim_time",
        default_value="false",
        description="Make MoveIt to use simulation time. This is needed for the trajectory planing in simulation.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument(
        "prefix",
        default_value='""',
        description="Prefix of the joint names, useful for "
        "multi-robot setup. If changed than also joint names in the controllers' configuration "
        "have to be updated.",
    )
)
declared_arguments.append(
    DeclareLaunchArgument("launch_rviz", default_value="true", description="Launch RViz?")
)
declared_arguments.append(
    DeclareLaunchArgument("launch_servo", default_value="true", description="Launch Servo?")
)
"""ur_dir = get_package_share_directory('ur_moveit_config')
ur_launch_dir = os.path.join(ur_dir, 'launch')
declared_arguments.append(
    IncludeLaunchDescription(
    PythonLaunchDescriptionSource(os.path.join(ur_launch_dir, 'sensor_kinect_pointcloud.launch.xml'))
    )
)"""
return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup),])"""

Expected behavior

Move group should upload the libraries and publish the planning scene

Actual behavior

[ERROR] [move_group-12]: process has died [pid 155208, exit code -6, cmd '/home/marwin/mes_ws/install/moveit_ros_move_group/lib/moveit_ros_move_group/move_group --ros-args --params-file /tmp/launch_params_77ryurbf --params-file /tmp/launch_params_fkgxrldg --params-file /tmp/launch_params_30pbkqaw --params-file /home/marwin/mes_ws/install/ur_moveit_config/share/ur_moveit_config/config/kinematics.yaml --params-file /tmp/launch_params_7u2wol31 --params-file /tmp/launch_params_h6lpmb1w --params-file /tmp/launch_params_xuu8x1_1 --params-file /tmp/launch_params_cu779mx1 --params-file /tmp/launch_params_siz37d0s --params-file /tmp/launch_params_pn40jguh --params-file /tmp/launch_params_syqj3p3w'].

Backtrace or Console output

No response

@t-glez t-glez added the bug Something isn't working label Oct 8, 2024
@t-glez t-glez changed the title Move group dizing Move group diying Oct 8, 2024
@sea-bass
Copy link
Contributor

sea-bass commented Oct 8, 2024

Could you share your full console log? Usually there are other errors above the part you shared that indicate the actual problem.

@t-glez
Copy link
Author

t-glez commented Oct 8, 2024

launch.log

@mikeferguson
Copy link
Contributor

I would suggest uninstalling the moveit debians, and rebuilding your workspace. There are some ABI incompatibilities between what is in debs and what is in source and that definitely leads to some of these stranger crashes

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

3 participants