pyrobot.algorithms.base_controller.
BaseController
(configs, world, ros_launch_manager=None, robots={}, sensors={}, algorithms={})[source]¶Bases: pyrobot.algorithms.algorithm.Algorithm
Base class of Base controller algorithms.
Specifically, this algorithm handles moving base to absolute in the world frame, relative location in the base frame, and track pre-generated trajectories.
__init__
(configs, world, ros_launch_manager=None, robots={}, sensors={}, algorithms={})[source]¶Initialize self. See help(type(self)) for accurate signature.
check_cfg
()[source]¶This function checks required configs shared by all base controller instances in constructor.
The base controller algorithm handles one robot, and one robot only
The robot has a base
The base has a control subscriber which allows the controller to publish velocity commands
with customized algorithm config checks after calling this function using super().check_cfg()
go_to_absolute
(xyt_position, close_loop=True, smooth=True)[source]¶This function takes in desired xyt_position in world frame, and move the base to this xyt_position
desired translation along y-axis in world frame (meters), desired orientation in world frame (radius) respectively.
close_loop: bool. Specify if the controller should work in close loop. Default: True smooth: bool. Specify if the controller should generate smooth motion. Default: True
status: bool. True if the base gets to the target xyt pose; False otherwise.
go_to_relative
(xyt_position, close_loop=True, smooth=True)[source]¶This function takes in desired xyt_position in base frame, and move the base to this xyt_position
desired translation along y-axis in base frame (meters), desired orientation in base frame (radius) respectively.
close_loop: bool. Specify if the controller should work in close loop. Default: True smooth: bool. Specify if the controller should generate smooth motion. Default: True
status: bool. True if the base gets to the target xyt pose; False otherwise.
track_trajectory
(states, close_loop=True)[source]¶This function takes in a trajectory of (x, y, theta) points in world frame, and move the base to follow the trajectory
states: a list of (x, y, theta) vectors [[x1, y1, theta1], …, [xn, yn, thetan]] such that in each entry
x denotes desired translation along x-axis in world frame (meters), y denotes desired translation along y-axis in world frame (meters), theta denotes desired orientation in world frame (radius) respectively.
close_loop: bool. Specify if the controller should work in close loop. Default: True
status: bool. True if the base gets to all xyt-points in states; False otherwise.