Module API

rocon_console

This is the top-level namespace of the rocon_console ROS package. It provides nodes, utilities and supporting libraries for enabling interactions between users and a ros master.

rocon_console.console

Colour definitions and logging functions for colourising the console.


Colour Definitions

The current list of colour definitions include:

  • Regular: black, red, green, yellow, blue, magenta, cyan, white,
  • Bold: bold, bold_black, bold_red, bold_green, bold_yellow, bold_blue, bold_magenta, bold_cyan, bold_white

These colour definitions can be used in the following way:

import rocon_console.console as console
print(console.cyan + "    Name" + console.reset + ": " + console.yellow + "Dude" + console.reset)

rocon_console.console.console_has_colours(stream)[source]

Detects if the specified stream has colourising capability.

Parameters:stream – stream to check (typically sys.stdout)
rocon_console.console.logdebug(message)[source]

Prefixes ‘[debug]’ and colours the message green.

Parameters:str (message) – message to log.
rocon_console.console.logerror(message)[source]

Prefixes ‘[error]’ and colours the message red.

Parameters:str (message) – message to log.
rocon_console.console.logfatal(message)[source]

Prefixes ‘[fatal]’ and colours the message bold red.

Parameters:str (message) – message to log.
rocon_console.console.loginfo(message)[source]

Prefixes ‘[info]’ to the message.

Parameters:str (message) – message to log.
rocon_console.console.logwarn(message)[source]

Prefixes ‘[warn]’ and colours the message yellow.

Parameters:str (message) – message to log.

Table Of Contents

Previous topic

Colouring the Console

This Page