panda_gazebo.core.control_server

This server is responsible for controlling the Panda arm. It created several (action) services that can be used to send control commands to the Panda Robot arm and hand. These services wrap around the original control topics and services created by the franka_ros and ros_control packages and add extra functionality. They allow you to wait for control commands to be completed, send incomplete control commands and incomplete trajectories (i.e. control commands/trajectories that do not contain all the joints).

Main services:
  • get_controlled_joints

  • follow_joint_trajectory

  • set_joint_commands

  • panda_hand/set_gripper_width

Main actions:
  • panda_arm/follow_joint_trajectory

Extra services:
  • panda_arm/set_joint_positions

  • panda_arm/set_joint_efforts

Module Contents

Classes

PandaControlServer

Controller server used to send control commands to the simulated Panda Robot.

Attributes

GRASP_EPSILON

GRASP_SPEED

GRASP_FORCE

GRIPPER_ACTION_TIMEOUT

DIRNAME

PANDA_JOINTS

ARM_POSITION_CONTROLLER

ARM_EFFORT_CONTROLLER

ARM_TRAJ_CONTROLLER

HAND_CONTROLLER

CONTROLLER_INFO_RATE

CONNECTION_TIMEOUT

panda_gazebo.core.control_server.GRASP_EPSILON = 0.003[source]
panda_gazebo.core.control_server.GRASP_SPEED = 0.1[source]
panda_gazebo.core.control_server.GRASP_FORCE = 10[source]
panda_gazebo.core.control_server.GRIPPER_ACTION_TIMEOUT = 5[source]
panda_gazebo.core.control_server.DIRNAME[source]
panda_gazebo.core.control_server.PANDA_JOINTS[source]
panda_gazebo.core.control_server.ARM_POSITION_CONTROLLER = 'panda_arm_joint_position_controller'[source]
panda_gazebo.core.control_server.ARM_EFFORT_CONTROLLER = 'panda_arm_joint_effort_controller'[source]
panda_gazebo.core.control_server.ARM_TRAJ_CONTROLLER = 'panda_arm_trajectory_controller'[source]
panda_gazebo.core.control_server.HAND_CONTROLLER = 'franka_gripper'[source]
panda_gazebo.core.control_server.CONTROLLER_INFO_RATE[source]
panda_gazebo.core.control_server.CONNECTION_TIMEOUT = 10[source]
class panda_gazebo.core.control_server.PandaControlServer(autofill_traj_positions=False, load_gripper=True, load_set_joint_commands_service=True, load_arm_follow_joint_trajectory_action=False, load_extra_services=False, controllers_check_rate=CONTROLLER_INFO_RATE)[source]

Bases: object

Controller server used to send control commands to the simulated Panda Robot.

joint_states

The current joint states.

Type:

sensor_msgs.JointState

arm_joint_positions_threshold

The current threshold for determining whether the arm joint positions are within the given setpoint.

Type:

float

arm_joint_efforts_threshold

The current threshold for determining whether the arm joint efforts are within the given setpoint.

Type:

float

arm_velocity_threshold

The current threshold for determining whether the arm has zero velocity.

Type:

float

Initialise PandaControlServer object.

Parameters:
  • autofill_traj_positions (bool, optional) – Whether you want to automatically set the current states as positions when the positions field of the joint trajectory message is left empty. Defaults to False.

  • load_gripper (boolean, optional) – Whether we also want to load the gripper control services.

  • load_set_joint_commands_service (boolean, optional) – Whether the set joint commands service should be loaded. This service is used by the ros_gazebo_gym package when the control type is NOT set to trajectory. Defaults, to True.

  • load_arm_follow_joint_trajectory_action (boolean, optional) – Whether the arm follow joint trajectory action should be loaded. This service is used by the ros_gazebo_gym package when the control type is set to trajectory. Defaults, to False.

  • load_extra_services (bool, optional) – Whether to load extra services that are not used by the ros_gazebo_gym package. Defaults to False.

  • controllers_check_rate (float, optional) – Rate at which the availability of the used controllers is checked. Setting this to -1 will check at every time step. Defaults to 0.1 Hz.

Warning

Please note that increasing the controllers_check_rate decreases the control frequency.

property arm_trajectory_action_preempted[source]

Returns whether the arm joint trajectory action server is preempted.

property controlled_joints[source]

Returns the joints that can be controlled by a each control type.

Important

This does not mean that the necessary controller is running. It only means that the controller was loaded and can be used to control the joints when it is started.

Returns:

A dictionary containing the joints that are controlled when using a

given control type (i.e. control_type>``control_group``>``controller``).

Return type:

dict

property joint_controllers[source]

Retrieves the controllers which are currently loaded to control each joint.

Returns:

A dictionary where the keys are joint names and the values are

lists of controllers that can control the joint.

Return type:

dict

property controllers[source]

Retrieves info about the loaded controllers.

Note

This method is cached to reduce the number of calls to the controller manager and therefore increase performance.

Returns:

Dictionary with information about the currently loaded controllers.

Return type:

dict

property gripper_width[source]

Returns the gripper width as calculated based on the Panda finger joints.

Returns:

The gripper width.

Return type:

float