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.

  1. giskard_wrapper.get_result(self, timeout=rospy.Duration())
  2. 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.

  1. get_robot_name()
  2. get_root()

Playing God

The wrapper also has various methods to manipulate the world, e.g.:

  1. add_box(name='box', size=(1, 1, 1), pose=PoseStamped()) – create a box in the world
  2. attach_object(name='box', link_frame_id='r_gripper_tool_frame') – attach an existing object to the robot
  3. detach_object(object_name='box') – detaches an object and spawns it in the world again.
  4. clear_world() – remove everything except for the robot

Collision Avoidance

Use these functions to influence the collision avoidance.

  1. allow_all_collisions()
  2. allow_self_collision()
  3. avoid_all_collisions() – You only need this function, if you want to be specific, because it is the default.
  4. allow_collision(robot_links=(CollisionEntry.ALL,), body_b=CollisionEntry.ALL, link_bs=(CollisionEntry.ALL,))
  5. avoid_collision(min_dist, robot_links=(CollisionEntry.ALL,), body_b=CollisionEntry.ALL, link_bs=(CollisionEntry.ALL,))