ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

MoveIt2 tutorial error Pick and Place

asked 2022-10-13 01:52:45 -0600

LucB gravatar image

updated 2022-10-13 01:54:01 -0600

I'm using ros2 humble. I try to run the pick and place source code from the Moveit2 tutorial.

At first i run

ros2 launch moveit2_tutorials mtc_demo.launch.py

after i start

ros2 launch moveit2_tutorials pick_place_demo.launch.py

In RViz the pandas arm and a green cylinder spawns and I get following output.

ros2 launch moveit2_tutorials pick_place_demo.launch.py
[INFO] [launch]: All log files can be found below /home/luca/.ros/log/2022-10-13-08-33-46-627618-Lenovo-V15-G2-ALC-5420
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [mtc_tutorial-1]: process started with pid [5421]
[mtc_tutorial-1] [INFO] [1665642826.962234071] [moveit_rdf_loader.rdf_loader]: Loaded robot model in 0.00403836 seconds
[mtc_tutorial-1] [INFO] [1665642826.962293297] [moveit_robot_model.robot_model]: Loading robot model 'panda'...
[mtc_tutorial-1] Link panda_link1 had 1 children
[mtc_tutorial-1] Link panda_link2 had 1 children
[mtc_tutorial-1] Link panda_link3 had 1 children
[mtc_tutorial-1] Link panda_link4 had 1 children
[mtc_tutorial-1] Link panda_link5 had 1 children
[mtc_tutorial-1] Link panda_link6 had 1 children
[mtc_tutorial-1] Link panda_link7 had 1 children
[mtc_tutorial-1] Link panda_link8 had 1 children
[mtc_tutorial-1] Link panda_hand had 2 children
[mtc_tutorial-1] Link panda_leftfinger had 0 children
[mtc_tutorial-1] Link panda_rightfinger had 0 children
[mtc_tutorial-1] terminate called after throwing an instance of 'moveit::task_constructor::Property::undeclared'
[mtc_tutorial-1]   what():  Property 'hand': undeclared
[mtc_tutorial-1] Stack trace (most recent call last):
[mtc_tutorial-1] #16   Object "", at 0xffffffffffffffff, in 
[mtc_tutorial-1] #15   Object "/home/.../ws_moveit2/install/moveit2_tutorials/lib/moveit2_tutorials/mtc_tutorial", at 0x5635b0c89044, in _start
[mtc_tutorial-1] #14   Source "../csu/libc-start.c", line 392, in __libc_start_main_impl [0x7f5663c68e3f]
[mtc_tutorial-1] #13   Source "../sysdeps/nptl/libc_start_call_main.h", line 58, in __libc_start_call_main [0x7f5663c68d8f]
[mtc_tutorial-1] #12   Source "/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp", line 375, in main [0x5635b0c8e743]
[mtc_tutorial-1]         372:   });
[mtc_tutorial-1]         373: 
[mtc_tutorial-1]         374:   mtc_task_node->setupPlanningScene();
[mtc_tutorial-1]       > 375:   mtc_task_node->doTask();
[mtc_tutorial-1]         376: 
[mtc_tutorial-1]         377:   spin_thread->join();
[mtc_tutorial-1]         378:   rclcpp::shutdown();
[mtc_tutorial-1] #11   Source "/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp", line 69, in doTask [0x5635b0c895ec]
[mtc_tutorial-1]          67: void MTCTaskNode::doTask()
[mtc_tutorial-1]          68: {
[mtc_tutorial-1]       >  69:   task_ = createTask();
[mtc_tutorial-1]          70: 
[mtc_tutorial-1]          71:   try
[mtc_tutorial-1]          72:   {
[mtc_tutorial-1] #10   Source "/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp", line 152, in createTask [0x5635b0c8a615]
[mtc_tutorial-1]         149:   // In fact, `task` itself is a SerialContainer by default.
[mtc_tutorial-1]         150:   {
[mtc_tutorial-1]         151:     auto grasp = std::make_unique<mtc::SerialContainer>("pick object");
[mtc_tutorial-1]       > 152:     task.properties().exposeTo(grasp->properties(), { "eef", "hand", "group", "ik_frame" });
[mtc_tutorial-1]         153:     // clang-format off
[mtc_tutorial-1]         154:     grasp->properties().configureInitFrom(mtc::Stage::PARENT,
[mtc_tutorial-1]         155:                                           { "eef", "hand", "group", "ik_frame" });
[mtc_tutorial-1] #9    Object "/home/.../ws_moveit2/install/moveit_task_constructor_core/lib/libmoveit_task_constructor_core.so", at 0x7f566458faf9, in moveit::task_constructor::PropertyMap::exposeTo(moveit::task_constructor::PropertyMap&, std::set<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&) const
[mtc_tutorial-1] #8    Object "/home/.../ws_moveit2/install/moveit_task_constructor_core/lib/libmoveit_task_constructor_core.so", at 0x7f566458fa98, in moveit::task_constructor::PropertyMap::exposeTo(moveit::task_constructor::PropertyMap&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
[mtc_tutorial-1] #7    Object "/home/.../ws_moveit2/install/moveit_task_constructor_core/lib/libmoveit_task_constructor_core.so", at 0x7f566453ab85, in moveit::task_constructor::PropertyMap::property(std::__cxx11::basic_string<char, std ...
(more)
edit retag flag offensive close merge delete

Comments

It can not find the property 'hand'. Did you define it? For example

  const auto& hand_group_name = "hand";
  ...
  task.setProperty("eef", hand_group_name);

Feel free to look at moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/src/main.cpp

ravijoshi gravatar image ravijoshi  ( 2022-10-13 04:35:45 -0600 )edit

Since i'm launching

ros2 launch moveit2_tutorials pick_place_demo.launch.py

i assume exactly this file will be started, right?

Here is the path of the file

/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorial/pick_and_place_with_moveit_task_constructor/src
LucB gravatar image LucB  ( 2022-10-13 04:55:45 -0600 )edit

I'm not sure about what it is launching because in the Launchfile

/home/.../ws_moveit2/src/moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/launch/pick_place_demo.launch.py

it says the executable mtc_tutorial is in the package moveit2_tutorials.

from launch import LaunchDescription
from launch_ros.actions import Node
from moveit_configs_utils import MoveItConfigsBuilder


def generate_launch_description():
    moveit_config = MoveItConfigsBuilder("moveit_resources_panda").to_dict()

    # MTC Demo node
    pick_place_demo = Node(
        #package="mtc_tutorial",
        #executable="mtc_tutorial",
        package="moveit2_tutorials",
        executable="mtc_tutorial",
        output="screen",
        parameters=[
            moveit_config,
        ],
    )

    return LaunchDescription([pick_place_demo])

But i cant find the executable mtc_tutorial in there.

LucB gravatar image LucB  ( 2022-10-13 05:48:30 -0600 )edit

But i cant find the executable mtc_tutorial in there ...

It is mentioned moveit2_tutorials/doc/tutorials/pick_and_place_with_moveit_task_constructor/CMakeLists.txt#L1-L3

ravijoshi gravatar image ravijoshi  ( 2022-10-13 22:10:52 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-10-14 02:14:47 -0600

ravijoshi gravatar image

updated 2022-10-14 02:16:52 -0600

I spent some time trying to understand this issue.

I realized it is a bug in the humble branch of the moveit2_tutorials. So I used the main branch and compiled the workspace as well. It worked without any issues.

Please see the bug report here.

edit flag offensive delete link more

Comments

I changed the code in my src/main.cpp file to the source code of the main branch. Now it works.

Thanks!!

LucB gravatar image LucB  ( 2022-10-14 03:19:50 -0600 )edit

I am glad you made it work!

ravijoshi gravatar image ravijoshi  ( 2022-10-14 06:26:27 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2022-10-13 01:52:45 -0600

Seen: 850 times

Last updated: Oct 14 '22