Table of Contents
Setting Goals
The class ''GiskardWrapper'' is a python wrapper around Giskard's action server interface. It can be imported like this
from giskardpy.python_interface import GiskardWrapper
Creating an instance will automatically wait for and connect to Giskard
giskard_wrapper = GiskardWrapper()
It has several functions to add goals e.g.
giskard_wrapper.set_joint_goal({'torso_lift_joint':0.2})
or
giskard_wrapper.set_cart_goal('torso_lift_link', 'r_gripper_tool_frame', PoseStamped())
They get automatically appended to the same MoveCmd
, you can use
giskard_wrapper.plan_and_execute(wait=True)
to execute the command.
Alternatively, you might want to set wait=False
to have the command not block the program and use the following commands to stop the execution or check if it has finished.
giskard_wrapper.get_result(self, timeout=rospy.Duration())
giskard_wrapper.interrupt()
If you want to have a sequence of motions, you can use
giskard_wrapper.add_cmd()
to start a new MoveCmd
.
You might also find these functions helpful.
get_robot_name()
get_root()
Playing God
The wrapper also has various methods to manipulate the world, e.g.:
add_box(name='box', size=(1, 1, 1), pose=PoseStamped())
– create a box in the worldattach_object(name='box', link_frame_id='r_gripper_tool_frame')
– attach an existing object to the robotdetach_object(object_name='box')
– detaches an object and spawns it in the world again.clear_world()
– remove everything except for the robot
Collision Avoidance
Use these functions to influence the collision avoidance.
allow_all_collisions()
allow_self_collision()
avoid_all_collisions()
– You only need this function, if you want to be specific, because it is the default.allow_collision(robot_links=(CollisionEntry.ALL,), body_b=CollisionEntry.ALL, link_bs=(CollisionEntry.ALL,))
avoid_collision(min_dist, robot_links=(CollisionEntry.ALL,), body_b=CollisionEntry.ALL, link_bs=(CollisionEntry.ALL,))