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

Issue with robot_description_semantic in running the tutorial "Your first C++ MoveIt Project" #528

Closed
Sraobot opened this issue Oct 7, 2022 · 13 comments

Comments

@Sraobot
Copy link

Sraobot commented Oct 7, 2022

Description and Steps to reproduce

I am trying to run the Your First C++ MoveIt Project. The code I used is hello_moveit.cpp which is provided at the end of tutorial webpage. When I run ros2 run hello_moveit hello_moveit, I get this error

[ERROR] [1664720561.886608829] [hello_moveit]: Could not find parameter robot_description_semantic and did not receive robot_description_semantic via std_msgs::msg::String subscription within 10.000000 seconds. 
Error:   Could not parse the SRDF XML File. Error=XML_ERROR_EMPTY_DOCUMENT ErrorID=13 (0xd) Line number=0
         at line 715 in ./src/model.cpp
[ERROR] [1664720561.900546627] [moveit_rdf_loader.rdf_loader]: Unable to parse SRDF
[FATAL] [1664720561.901184806] [move_group_interface]: Unable to construct robot model. Please make sure all needed information is on the parameter server.
    terminate called after throwing an instance of 'std::runtime_error'
    what():  Unable to construct robot model. Please make sure all needed information is on the parameter server.
[ros2run]: Aborted 

Before running the command ros2 run hello_moveit hello_moveit, I did run ros2 launch moveit2_tutorials demo.launch.py as mentioned in the tutorial.

The error mentions could not find robot_description_semantic but when I run the command ros2 param get | grep robot_description_semantic, I get 6 results from the nodes /move_group, /moveit_simple_controller_manager and /rviz2. Each of the mentioned nodes has 2 parameters robot_description_semantic and publish_description_semantic which makes 6 parameters as reported by grep.

I try to check what is in robot_description_semantic for each of the nodes using ros2 param get <node_name> robot_description_semantic, I get the same result for each of them which is probably a URDF file.

Now, I check for publish_robot_description_semantic in each of those nodes.
For /move_group and /moveit_simple_controller_manager, I get Boolean Value is: False and for /rviz2 I get Parameter not set.
In this comment, #262 (comment) it was mentioned about setting "publish_robot_description_semantic" to True. So, I try to do this.

For /move_group node, I set publish_robot_description_semantic parameter to True but still not able to run ros2 run hello_moveit hello_moveit. Then, I tried to do for /rviz2, it gets set successfully to True but still the code does not run. Then, I try for /moveit_simple_controller_manager, the parameter change command returns Setting parameter failed.

Your environment

  • ROS Distro: Humble
  • OS Version: Ubuntu 22.04
  • Source build as mentioned in the tutorial

Expected behaviour

ros2 run hello_moveit hello_moveit should run and move the arm to the desired pose as mentioned in hello_moveit.cpp.

@tylerjw
Copy link
Member

tylerjw commented Oct 7, 2022

Thank you for the bug report. I'll try to reproduce this to see if I can figure out what is broken.

@tylerjw
Copy link
Member

tylerjw commented Oct 7, 2022

Hello, I just tried reproducing the results you found and it worked for me.

In my first terminal I ran the command:

ros2 launch moveit2_tutorials demo.launch.py

In the second terminal I ran this command:

ros2 run hello_moveit hello_moveit

Here is the output from the second command:

[INFO] [1665155355.124441045] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.0316463 seconds
[INFO] [1665155355.124492254] [moveit_robot_model.robot_model]: Loading robot model 'panda'...
[WARN] [1665155355.132849302] [moveit_ros.robot_model_loader]: No kinematics plugins defined. Fill and load kinematics.yaml!
[INFO] [1665155355.139967287] [move_group_interface]: Ready to take commands for planning group panda_arm.
[INFO] [1665155355.140000386] [move_group_interface]: MoveGroup action client/server ready
[INFO] [1665155355.140427501] [move_group_interface]: Planning request accepted
[INFO] [1665155355.200565006] [move_group_interface]: Planning request complete!
[INFO] [1665155355.240235134] [move_group_interface]: time taken to generate plan: 0.0237555 seconds
[INFO] [1665155355.240641639] [move_group_interface]: Execute request accepted
[INFO] [1665155365.662103756] [move_group_interface]: Execute request success!

With rviz running if I run this command to see if move_group is configured correctly to publish the description I get true:

ros2 param get /move_group publish_robot_description_semantic
Boolean value is: True

Do you mind running this command in the source directory of your workspace and pasting the output in the issue here. For comparison here is what is in my workspace;

vcs export --exact-with-tags
repositories:
  launch_param_builder:
    type: git
    url: https://github.com/PickNikRobotics/launch_param_builder
    version: 0.1.1
  moveit2:
    type: git
    url: https://github.com/ros-planning/moveit2
    version: 5a589fcfe350a1f91b2715c4099ccd4aca745b0f
  moveit2_tutorials:
    type: git
    url: https://github.com/ros-planning/moveit2_tutorials
    version: 1563a2e15fa2f19a8a0c3bb5c0b6848ae3106751
  moveit_resources:
    type: git
    url: https://github.com/ros-planning/moveit_resources
    version: ded1d5a09158e04b37b5eb521534cfd88967b0ed
  moveit_task_constructor:
    type: git
    url: https://github.com/ros-planning/moveit_task_constructor.git
    version: 1e65027b26744dccd02bd7d7ac4d0856916cfde5
  moveit_visual_tools:
    type: git
    url: https://github.com/ros-planning/moveit_visual_tools
    version: 5e088415d14ed9becda154fd3cb73bb85041abe2
  rosparam_shortcuts:
    type: git
    url: https://github.com/PickNikRobotics/rosparam_shortcuts
    version: 0.5.0
  srdfdom:
    type: git
    url: https://github.com/ros-planning/srdfdom.git
    version: 91d7db8b28d64008145a7281febd08c2f59a0fe8

@Sraobot
Copy link
Author

Sraobot commented Oct 7, 2022

@tylerjw When I run the command vcs export --exact-with-tags I get this output

repositories:
  moveit2:
    type: git
    url: https://github.com/ros-planning/moveit2
    version: 5c3f98ee4733829154e5de395f9d6eee0b7fd2d9
  moveit2_tutorials:
    type: git
    url: https://github.com/ros-planning/moveit2_tutorials
    version: 27faa8ea60ffe4e1f49ce49502b77557626fcae5
  moveit_resources:
    type: git
    url: https://github.com/ros-planning/moveit_resources
    version: 46ab718dc336c2a7fc5375d462e6eddc2b7dd37c
  moveit_task_constructor:
    type: git
    url: https://github.com/ros-planning/moveit_task_constructor.git
    version: 1e65027b26744dccd02bd7d7ac4d0856916cfde5
  moveit_visual_tools:
    type: git
    url: https://github.com/ros-planning/moveit_visual_tools
    version: 5e088415d14ed9becda154fd3cb73bb85041abe2
  ros2_control:
    type: git
    url: https://github.com/ros-controls/ros2_control.git
    version: 2.13.0
  rosparam_shortcuts:
    type: git
    url: https://github.com/PickNikRobotics/rosparam_shortcuts
    version: 0.5.0
  rviz_visual_tools:
    type: git
    url: https://github.com/PickNikRobotics/rviz_visual_tools.git
    version: 4.1.3

@tylerjw
Copy link
Member

tylerjw commented Oct 7, 2022

Sweet, I think I know what happened. That looks like you checked out the rolling version of the tutorials and not the humble version. That means that you also built a workspace that is setup for rolling and not humble.

image

Please delete the code in your source directory and start over on this starting with the Download Source step of getting started:

@Sraobot
Copy link
Author

Sraobot commented Oct 7, 2022

Ok. I will build again and let you know.

@Sraobot
Copy link
Author

Sraobot commented Oct 8, 2022

Thanks. It works now.

@pirate999
Copy link

I have the same problem, I use
Ubuntu20.04, ros foxy, moveit2
and I git clone moveit2_tutorials foxy branch

ERROR] [1680406587.092033426] [hello_moveit]: Could not find parameter robot_description_semantic and did not receive robot_description_semantic via std_msgs::msg::String subscription within 10.000000 seconds

@pirate999
Copy link

pirate999 commented Apr 2, 2023

Sweet, I think I know what happened. That looks like you checked out the rolling version of the tutorials and not the humble version. That means that you also built a workspace that is setup for rolling and not humble.

image

Please delete the code in your source directory and start over on this starting with the Download Source step of getting started:

Hi, I have the same problem, I use Ubuntu20.04, ros foxy, moveit2, and I git clone moveit2_tutorials foxy branch

@130s
Copy link
Contributor

130s commented May 3, 2023

Just cross-referencing for the future readers, I think this ticket and answers.ros.org#407290 are opened by the same person about the same question.

@yinguoxiangyi
Copy link

I use the galactic branch and have also the same problem.
answers.ros.org#407290 and #631 give the hint.
Adding following lines to planning_scene_monitor_parameters dictionary in file demo.launch.py of package moveit2_tutorials can solve the issue.

 "publish_robot_description":True,
 "publish_robot_description_semantic":True,

@tylerjw
Copy link
Member

tylerjw commented May 30, 2023

We removed the galactic and foxy versions of the tutorials from the site because there are issues with them; they are EOL versions of ROS and are not supported.

@RodBelaFarin
Copy link

Same problem with humble, too.

@newtonjeri
Copy link

I use the galactic branch and have also the same problem. answers.ros.org#407290 and #631 give the hint. Adding following lines to planning_scene_monitor_parameters dictionary in file demo.launch.py of package moveit2_tutorials can solve the issue.

 "publish_robot_description":True,
 "publish_robot_description_semantic":True,

Thanks, it worked for me, am using ROS2 humble

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

7 participants