Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
wiki:tutorials:single-arm-cartesian-move-python [2019/11/18 14:22]
simon [The Code explained]
wiki:tutorials:single-arm-cartesian-move-python [2020/10/21 10:39] (current)
simon [The Code]
Line 3: Line 3:
 =====The Code===== =====The Code=====
 <code python> <code python>
 +
 import actionlib import actionlib
 import rospy import rospy
Line 13: Line 14:
     # Creates the SimpleActionClient,​ passing the type of the action     # Creates the SimpleActionClient,​ passing the type of the action
     # (MoveAction) to the constructor.     # (MoveAction) to the constructor.
-    client = actionlib.SimpleActionClient("/​giskardpy/​command",​ MoveAction)+    client = actionlib.SimpleActionClient("/​giskard/​command",​ MoveAction)
  
     # Waits until the action server has started up and started     # Waits until the action server has started up and started
Line 58: Line 59:
  
     result = client.get_result() ​ # type: MoveResult     result = client.get_result() ​ # type: MoveResult
-    if result.error_code ​== MoveResult.SUCCESS:​+    if result.error_codes[0] ​== MoveResult.SUCCESS:​
         print('​giskard returned success'​)         print('​giskard returned success'​)
     else:     else:
Line 72: Line 73:
     except rospy.ROSInterruptException:​     except rospy.ROSInterruptException:​
         print("​program interrupted before completion"​)         print("​program interrupted before completion"​)
- 
 </​code>​ </​code>​