basic_robotics.utilities.disp module

Console display helpers for pretty-printing matrices, transforms, and progress bars.

basic_robotics.utilities.disp.disp(matrix, title='MATRIX', nd=3, mode=0, pdims=True, noprint=False)[source]

Drop in replacement for python print. Operates like Matlab’s disp() function. Takes in an object to print, a title, and an optional mode :param matrix: the item to be printed (does not have to be a matrix) :param title: An optional title or caption to be applied to the printed item :param nd: number of decimal places :param mode: whether or not to print the context in latex table format :param pdims: print dimensions :param noprint: simply return a string without printing anything

Returns:

String

basic_robotics.utilities.disp.dispa(matrix, title='MATRIX', nd=3, pdims=True, h='', new=True)[source]

Helper function for disp, used recursively :param matrix: item to be printed :param nd: number of decimal places :param pdims: print dimensions :param h: existing string :param new: if this is a new call

Returns:

String

basic_robotics.utilities.disp.disptex(matrix, title, nd=3, pdims=True, h='')[source]

Prints a matrix in latex format. :param matrix: matrix to be printed :param title: caption :param nd: number of decimal places to round to :param pdims: print dimensions :param h: existing string

Returns:

String

basic_robotics.utilities.disp.printTFlist(matrix, title, nd, print_names=True, tm_names=True)[source]

Prints a list of TM objects (TF was deprecated) :param matrix: list of tms to be printed :param title: caption :param nd: number of decimal places to round to

Returns:

String

basic_robotics.utilities.disp.progressBar(iteration, total, prefix='', suffix='', decimals=1, length=100, fill='#', ETA=None)[source]

Prints a progress bar, can use ETA. Adapted from here: https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console

Parameters:
  • iteration – current iteration

  • total – goal number of iterations

  • prefix – Optional- Text to append to the beginning

  • suffix – Optional - Text to append to the end (overwritten by ETA)

  • decimals – Optional - Decimals to round to

  • length – Optional - Length of progress bar in characters

  • fill – Optional - Fill Character

  • ETA – Optional - Time in seconds since start, triggers printing ETA in suffix