TAMS-Group / mtc_pour

MoveIt Task Constructor stage implementation for pouring
7 stars 9 forks source link

How do I run the demo? #1

Closed youtalk closed 4 months ago

youtalk commented 5 years ago

I was so impressed the "MoveIt! Task Planning" presentation at ROSCon 2018 and I want to run some demos using the moveit_task_constructor.

This repository was shown in the presentation but I cannot understand the way to run the demo. Do you have any idea? I've built it successfully though.

I tried the following way but nothing happened.

  1. roslaunch mtc_pour tams_ur5_demo_prerequisites.launch
  2. rosrun mtc_pour mtc_pour_tams_ur5_demo
v4hn commented 5 years ago

Hi there,

I tried the following way but nothing happened.

What does "nothing" mean? Did you setup a TAMS UR5 workspace (or the moveit-demo-mode part of it)? Did you add an MTC-display to RViz and connect it to the task topics? The demo launch does not provide a custom RViz config. Does something show up on the panel?

I just adapted the demos to use the new "pouring_axis" property and verified your commands work on my end with the change.

However, it seems like there have been major changes in ROS-industrials driver repositories lately and our code is not up to date. We will fix that shortly :unamused: , but you can probably use slightly older branches for the workspace.

captain-yoshi commented 5 years ago

I am currently testing the _mtc_pour_tams_ur5demo. At first I was getting errors that the computed solution was approximate. As you said above, the code is not up to date. So I then tried to comment out some task leaving only the 6 first tasks. A solution is found but when I try to execute the solution it loops forever. In RViz, there is nothing moving.

Here is the console print when running this command rosrun mtc_pour mtc_pour_tams_ur5_demo:

[ INFO] [1557336746.544845645]: Loading robot model 'tams_ur5_setup'...
[ INFO] [1557336746.545727237]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ WARN] [1557336746.594588724]: Kinematics solver doesn't support #attempts anymore, but only a timeout.
Please remove the parameter '/robot_description_kinematics/arm/kinematics_solver_attempts' from your configuration.
[ WARN] [1557336746.599647271]: IK plugin for group 'arm' relies on deprecated API. Please implement initialize(RobotModel, ...).
[ INFO] [1557336746.604055858]: Loading robot model 'tams_ur5_setup'...
[ INFO] [1557336746.604086460]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1557336746.635649958]: Going to execute first computed solution
[ INFO] [1557336746.635829701]:   -  -   --  0   --  -  - / my_task
    -  -   --  0   --  -  - / current state
    -  -   --  0   --  -  - / open gripper
    -  0   ->  0   <-  0  - / move to pre-grasp pose
    -  -   --  0   --  -  - / approach object
    -  -   --  0   --  -  - / grasp pose
      -  -   --  0   --  -  - / grasp workspace pose

[ INFO] [1557336746.655313434]: Initializing OMPL interface using ROS parameters
[ INFO] [1557336746.677823191]: Using planning interface 'OMPL'
[ INFO] [1557336746.680491815]: Param 'default_workspace_bounds' was not set. Using default value: 10
[ INFO] [1557336746.680783599]: Param 'start_state_max_bounds_error' was not set. Using default value: 0.05
[ INFO] [1557336746.681038330]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1557336746.681298480]: Param 'start_state_max_dt' was not set. Using default value: 0.5
[ INFO] [1557336746.681513059]: Param 'jiggle_fraction' was not set. Using default value: 0.02
[ INFO] [1557336746.681722969]: Param 'max_sampling_attempts' was not set. Using default value: 100
[ INFO] [1557336746.681751841]: Using planning request adapter 'Add Time Parameterization'
[ INFO] [1557336746.681762717]: Using planning request adapter 'Fix Workspace Bounds'
[ INFO] [1557336746.681792844]: Using planning request adapter 'Fix Start State Bounds'
[ INFO] [1557336746.681805391]: Using planning request adapter 'Fix Start State In Collision'
[ INFO] [1557336746.681814709]: Using planning request adapter 'Fix Start State Path Constraints'
[ INFO] [1557336746.765796718]: Planner configuration 'gripper' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1557336746.766587138]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1557336746.778913471]: RRTConnect: Created 4 states (2 start + 2 goal)
[ INFO] [1557336746.778981427]: Solution found in 0.012606 seconds
[ INFO] [1557336746.790006472]: SimpleSetup: Path simplification took 0.010901 seconds and changed from 3 to 2 states
[ INFO] [1557336747.399368974]: Planner configuration 'arm' will use planner 'geometric::RRTConnect'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1557336747.399775067]: RRTConnect: Starting planning with 1 states already in datastructure
[ INFO] [1557336747.433254261]: RRTConnect: Created 7 states (4 start + 3 goal)
[ INFO] [1557336747.433363753]: Solution found in 0.033762 seconds
[ INFO] [1557336747.512760215]: SimpleSetup: Path simplification took 0.079337 seconds and changed from 4 to 2 states
  1  -   <-  1   ->  -  1 / my_task
    1  -   <-  1   ->  -  0 / current state
    -  0   ->  1   ->  -  1 / open gripper
    -  1   ->  1   <-  2  - / move to pre-grasp pose
    2  -   <-  2   <-  1  - / approach object
    1  -   <-  7   ->  -  7 / grasp pose
     12  -   <- 12   ->  - 12 / grasp workspace pose
executing solution

Maybe an unrelated error. When trying to show the available stages in RViz, the console reports an error:

[rospack] Error: failed to parse command-line options: too many positional options have been specified on the command line
[librospack]: error while executing command 

EDIT 1: In function executeSolution from demo_utils.hpp the SimpleActionClient is waiting for the server but there is no server... The server is initialized in execute_task_solution_capability.cpp from pkg moveit_task_constructor but is never called. Is there a command missing to initialize the action lib server?

EDIT 2: In RViz displays Motion Planning Tasks there is a status error from the Task Monitor: Invalid topic. Expecting a name ending on "/solution".

EDIT 3: I can now view in RViz each step of a task. Very impressed with the motion planning tasks! The problem was on my side, I had a custom moveit package conflicting with the globally installed one. But I still cannot execute the solution (See EDIT 1).

captain-yoshi commented 5 years ago

Sorry for my long previous post. I found out that I had to load the MoveGroup capabilitie from moveit_task_constructor in the move_group.launch file:

<!-- load these non-default MoveGroup capabilities -->
<param name="capabilities" value="
             move_group/ExecuteTaskSolutionCapability
             " />

Now the robot executes the trajectory planned with the task constructor.