SoMa-Project / ec_grasp_planner

Grasp Planner Based on Environmental Constraint Exploitation
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Problem with example 7.iii #7

Closed EspenKnoop closed 6 years ago

EspenKnoop commented 6 years ago

I have followed the installation instructions. Example 7.i works fine. For example 7.iii (Kuka Arm in Gazebo Simulation with TRIK Controller), steps 1-4 work fine.

For step 5, I get the following error:

espen2@espen2-MacBookPro:~/catkin_ws/src/hybrid_automaton_manager_kuka/hybrid_automaton_manager_kuka/test_xmls$ rosrun ec_grasp_planner planner.py --grasp SurfaceGrasp --ros_service_call --rviz --handarm RBOHand2Kuka
Traceback (most recent call last):
  File "/home/espen2/catkin_ws/src/ec_grasp_planner/ec_grasp_planner/src/planner.py", line 466, in <module>
    main(**vars(args))
  File "/home/espen2/catkin_ws/src/ec_grasp_planner/ec_grasp_planner/src/planner.py", line 381, in main
    tf_listener.waitForTransform(object_frame, robot_base_frame, rospy.Time(), rospy.Duration(10.0))
  File "/opt/ros/indigo/lib/python2.7/dist-packages/tf/listener.py", line 76, in waitForTransform
    raise tf2_ros.TransformException(error_msg or "no such transformation: \"%s\" -> \"%s\"" % (source_frame, target_frame))
tf2.TransformException: canTransform: target_frame object does not exist.

If I run it without --ros_service_call, I get a different error:

espen2@espen2-MacBookPro:~/catkin_ws/src/hybrid_automaton_manager_kuka/hybrid_automaton_manager_kuka/test_xmls$ rosrun ec_grasp_planner planner.py --grasp SurfaceGrasp --handarm RBOHand2Kuka
Received graph with 10 nodes and 15 edges.
States Explored: 28
Time per state: 0.602 ms
Plan length: 3
move_hand(l0, l1)
move_object(l1, l2)
grasp_object(l2)
[[ 1.  0.  0.  0.]
 [ 0.  1.  0.  0.]
 [ 0.  0.  1.  0.]
 [ 0.  0.  0.  1.]]
Traceback (most recent call last):
  File "/home/espen2/catkin_ws/src/ec_grasp_planner/ec_grasp_planner/src/planner.py", line 466, in <module>
    main(**vars(args))
  File "/home/espen2/catkin_ws/src/ec_grasp_planner/ec_grasp_planner/src/planner.py", line 411, in main
    ha, rviz_frames = hybrid_automaton_from_motion_sequence(grasp_path, graph, graph_in_base, object_in_base, handarm_params)
  File "/home/espen2/catkin_ws/src/ec_grasp_planner/ec_grasp_planner/src/planner.py", line 223, in hybrid_automaton_from_motion_sequence
    return create_surface_grasp(T_object_in_base, support_surface_frame, handarm_params)
  File "/home/espen2/catkin_ws/src/ec_grasp_planner/ec_grasp_planner/src/planner.py", line 185, in create_surface_grasp
    return cookbook.sequence_of_modes_and_switches(control_sequence), rviz_frames
  File "/home/espen2/catkin_ws/src/ec_grasp_planner/ec_grasp_planner/../hybrid-automaton-tools-py/hatools/cookbook.py", line 29, in sequence_of_modes_and_switches
    assert(isinstance(mode, cp.ControlMode))
AssertionError

I am on branch master.

Thanks!

cerdogan commented 6 years ago

OK, I'd like to ask two things:

cerdogan commented 6 years ago

OK, Espen got the system running on his system. To do so, we changed two things:

  1. Add try/catch to the tf_listener.waitForTransform(object_frame, robot_base_frame, rospy.Time(), rospy.Duration(10.0)). Something like this: … while True: try: tf_listener.waitForTransform(object_frame, robot_base_frame, rospy.Time(), rospy.Duration(20.0)) break except: pass rospy.sleep(1)

  2. Make sure that the git submodule hybrid-automaton-tools-py in ec_grasp_planner is on branch soma_d41.