Base

class pyrobot.core.Base(configs)[source]

Bases: object

This is a parent class on which the robot specific Base classes would be built.

__init__(configs)[source]

The consturctor for Base class.

Parameters:configs (YACS CfgNode) – configurations for base
get_state(state_type)[source]

Returns the requested base pose in the (x,y, yaw) format.

Parameters:state_type (string) – Requested state type. Ex: Odom, SLAM, etc
Returns:pose: pose of the form [x, y, yaw]
Return type:list
go_to_absolute(xyt_position, use_map, close_loop, smooth)[source]

Moves the robot to the robot to given goal state in the world frame.

Parameters:
  • xyt_position (list) – The goal state of the form (x,y,t) in the world (map) frame.
  • use_map (bool) – When set to “True”, ensures that controler is using only free space on the map to move the robot.
  • close_loop (bool) – When set to “True”, ensures that controler is operating in open loop by taking account of odometry.
  • smooth (bool) – When set to “True”, ensures that the motion leading to the goal is a smooth one.
Returns:

True if successful; False otherwise (timeout, etc.)

Return type:

bool

go_to_relative(xyt_position, use_map, close_loop, smooth)[source]

Moves the robot to the robot to given goal state relative to its initial pose.

Parameters:
  • xyt_position (list) – The relative goal state of the form (x,y,t)
  • use_map (bool) – When set to “True”, ensures that controler is using only free space on the map to move the robot.
  • close_loop (bool) – When set to “True”, ensures that controler is operating in open loop by taking account of odometry.
  • smooth (bool) – When set to “True”, ensures that the motion leading to the goal is a smooth one.
Returns:

True if successful; False otherwise (timeout, etc.)

Return type:

bool

set_vel(fwd_speed, turn_speed, exe_time=1)[source]

Set the moving velocity of the base

Parameters:
  • fwd_speed – forward speed
  • turn_speed – turning speed
  • exe_time – execution time
stop()[source]

Stop the base

track_trajectory(states, controls, close_loop)[source]

State trajectory that the robot should track.

Parameters:
  • states (list) – sequence of (x,y,t) states that the robot should track.
  • controls (list) – optionally specify control sequence as well.
  • close_loop (bool) – whether to close loop on the computed control sequence or not.
Returns:

True if successful; False otherwise (timeout, etc.)

Return type:

bool