0
$\begingroup$

Rosanswers logo

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::char_traits<char>, std::allocator<char> > const&) [clone .cold]
[mtc_tutorial-1] #6    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7f5663f37517, in __cxa_throw
[mtc_tutorial-1] #5    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7f5663f372b6, in std::terminate()
[mtc_tutorial-1] #4    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7f5663f3724b, in 
[mtc_tutorial-1] #3    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7f5663f2bbbd, in 
[mtc_tutorial-1] #2    Source "./stdlib/abort.c", line 79, in abort [0x7f5663c677f2]
[mtc_tutorial-1] #1    Source "../sysdeps/posix/raise.c", line 26, in raise [0x7f5663c81475]
[mtc_tutorial-1] #0  | Source "./nptl/pthread_kill.c", line 89, in __pthread_kill_internal
[mtc_tutorial-1]     | Source "./nptl/pthread_kill.c", line 78, in __pthread_kill_implementation
[mtc_tutorial-1]       Source "./nptl/pthread_kill.c", line 44, in __pthread_kill [0x7f5663cd5a7c]
[mtc_tutorial-1] Aborted (Signal sent by tkill() 5421 1000)
[ERROR] [mtc_tutorial-1]: process has died [pid 5421, exit code -6, cmd '/home/luca/ws_moveit2/install/moveit2_tutorials/lib/moveit2_tutorials/mtc_tutorial --ros-args --params-file /tmp/launch_params_uvqqf67l

How can i solve this?


Originally posted by LucB on ROS Answers with karma: 42 on 2022-10-13

Post score: 0


Original comments

Comment by ravijoshi on 2022-10-13:
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

Comment by LucB on 2022-10-13:
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

Comment by LucB on 2022-10-13:
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.

Comment by ravijoshi on 2022-10-13:\

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

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by ravijoshi with karma: 1744 on 2022-10-14

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by LucB on 2022-10-14:
I changed the code in my src/main.cpp file to the source code of the main branch. Now it works.

Thanks!!

Comment by ravijoshi on 2022-10-14:
I am glad you made it work!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.