robot_smach_states.human_interaction.give_directions

Classes

GiveDirections

Robot tells the operator how to get to a certain entity

Functions

create_frame_from_points(p0, p1)

Creates a frame from two points. The origin of the frame is the first point. The x-direction points into the

in_room(room, position)

Checks if the given position is in the given room

get_room(rooms, position)

Checks if the given position is in one of the provided rooms

_test_rooms(robot)

Tests the 'get room' method

Module Contents

class robot_smach_states.human_interaction.give_directions.GiveDirections(robot, entity_designator, x_threshold=0.75, y_threshold=1.5)

Bases: smach.State

Robot tells the operator how to get to a certain entity

Init

Parameters:
  • robot (Robot) – API object

  • entity_designator (Designator) – resolving to the entity the operator wants to go to

  • x_threshold (float) – if the entity is closer than this distance in x-direction w.r.t. the path frame it is considered ‘passed’

  • y_threshold (float) – if the entity is closer than this distance in y-direction w.r.t. the path frame it is considered ‘passed’

_robot
_entity_designator
_x_threshold = 0.75
_y_threshold = 1.5
execute(userdata=None)
static get_entity_pose_in_path(point, next_point, entity_pose)

Computes the entity pose w.r.t. the virtual frame that is spanned by the two points

Parameters:
  • point (kdl.Vector) – First point in fixed frame

  • next_point (kdl.Vector) – Next point in fixed frame

  • entity_pose (kdl.Frame) – (kdl.Frame) Entity pose in fixed frame

Returns:

Entity pose in virtual ‘path’ frame

Return type:

kdl.Frame

robot_smach_states.human_interaction.give_directions.create_frame_from_points(p0, p1)

Creates a frame from two points. The origin of the frame is the first point. The x-direction points into the direction of the next point

Parameters:
  • p0 (kdl.Vector) – Origin of the frame

  • p1 (kdl.Vector) – x-direction of the frame will point to this vector

Returns:

Created frame

Return type:

kdl.Frame

robot_smach_states.human_interaction.give_directions.in_room(room, position)

Checks if the given position is in the given room

Parameters:
  • room (Entity) – Room entity

  • position (kdl.Vector) – position to check. N.B.: it is assumed this is w.r.t. the same frame as the room entities

Returns:

whether or not the position is in the room

Return type:

bool

robot_smach_states.human_interaction.give_directions.get_room(rooms, position)

Checks if the given position is in one of the provided rooms

Parameters:
  • rooms (list[Entity]) – list(Entity) containing all room entities

  • position (kdl.Vector) – position to check. N.B.: it is assumed this is w.r.t. the same frame as the room entities

Returns:

room entity

Return type:

Entity

Raises:

(RuntimeError)

robot_smach_states.human_interaction.give_directions._test_rooms(robot)

Tests the ‘get room’ method

Parameters:

robot (robot_skills.robot.Robot) –

Return type:

None