No version for distro humble. Known supported distros are highlighted in the buttons above.
No version for distro galactic. Known supported distros are highlighted in the buttons above.
No version for distro foxy. Known supported distros are highlighted in the buttons above.
No version for distro rolling. Known supported distros are highlighted in the buttons above.

Package Summary

Tags No category tags.
Version 2.0.2
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ctu-vras/ros-utils.git
VCS Type git
VCS Version master
Last Updated 2022-09-21
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

A Czech-army knife for ROS code written in Python.

Additional Links

Maintainers

  • Martin Pecka

Authors

  • Martin Pecka

cras_py_common

A Czech-army knife for ROS code written in Python.

The aim of this package is to provide some missing utility functions to rospy. Using libraries from this package, you should be able to write more efficient, safer and less error-prone code without much boilerplate. As this package is intended to handle a lot of the boring code for you "behind the scenes", ubiquitous effort was put into unit-testing everything, so that you can rely on the provided code without the usual fear whether it works or not.

This readme shortly introduces the provided libraries. Detailed documentation can be found in the comments in code and in the API docs. Examples of usage can be found in the dependent packages from ros-utils, and in the unit tests.

Parts of this package were used by team CTU-CRAS-Norlab in DARPA Subterranean Challenge.

Support and Build Status

This package is supported on Melodic and Noetic until their End of Life (and maybe later). It is occasionally tested with non-default GCC versions like Melodic+GCC8 or Noetic+GCC11.

Development versions: CI Dev melodic Dev noetic ubuntu Dev noetic debian

Release jobs Melodic Melodic version: Bin melodic-amd64 Bin melodic-arm64 Bin melodic-armhf

Release jobs Noetic Noetic version: Bin ubuntu noetic-amd64 Bin ubuntu noetic-arm64 Bin ubuntu noetic-armhf Bin debian noetic-amd64 Bin debian noetic-arm64

List of Provided Modules

The most useful functions and classes from these modules are available directly from the cras package, i.e.

from cras import to_str
# instead of
from cras.string_utils import to_str

  • geometry_utils: Finally THE module providing easy and foolproof conversion between quaternions and roll/pitch/yaw notation.
  • log_utils: Some convenience for rospy logging. This is mostly an internal library, but it can be used elsewhere, too.
  • param_utils: Utilities for type-safe, easy, unified and configurable access to ROS parameters. See below for examples and more details.
  • string_utils: Universal to_str() that converts almost anything to a sensible string.
  • test_utils: Utilities for writing unit tests, e.g. a tool that can "read" what was written by rospy.loginfo().
  • time_utils: Conversions between rospy.Rate and frequency. rospy.Rate equality comparison. Min/max time and duration constants.

param_utils: Parameter Reading Helpers

param_utils provide a type-safe, unified and highly configurable interface for reading ROS parameters. Read a numpy matrix, vector of unsigned ints, rospy.Duration or geometry_msgs.msg.Vector3 directly without the need to write a single line of conversion code or value checking. Type of the value to read is automatically determined either from the provided default value, or from result_type parameter.

Example usage:

from cras import get_param, GetParamException
from geometry_msgs.msg import Vector3

# read array of 3 doubles from parameter server into a geometry_msgs.msg.Vector3, defaulting to the specified vector if not set.
gravity = get_param("gravity", Vector3(0, 0, -9.81), "m.s^-2")

# required parameters are specified by not having a default; if you still want conversion to some type, use result_type
try:
    gravity2 = get_param("gravity", "m.s^-2", result_type=Vector3)
except GetParamException as e:
    # the exception is raised if the required parameter is not set
    # e.info contains details about the unsuccessful lookup
    print(e.info.message)

You can also configure the parameter lookup behavior, e.g. to throw exception if the value cannot be converted to the requested type (normally, the default value is used in such case):

# will throw GetParamException if int_param has a value different from 0 and 1
from cras import get_param
bool_param = get_param("int_param", False, throw_if_convert_fails=True)

Finally, there is also a more verbose version of get_param() that tells more about how the lookup went:

from cras import get_param_verbose
res = get_param_verbose("int", 0)
int_param = res.value
was_default_used = res.info.default_used

CHANGELOG

Changelog for package cras_py_common

2.0.2 (2022-08-29)

  • De-flake throttle test and enable catkin_lint when it has chance to run correctly.
  • Added website links.
  • Add linters and licenses.
  • Contributors: Martin Pecka

2.0.1 (2022-08-26)

  • Moved hack_frame_id from cras_py_common to cras_topic_tools.

1.0.0

  • Added improved static_transform_broadcaster for Python.
  • Added hack_frame_id
  • Added cras_py_common
  • Contributors: Martin Pecka

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged cras_py_common at answers.ros.org

Package Summary

Tags No category tags.
Version 2.0.2
License BSD
Build type CATKIN
Use RECOMMENDED

Repository Summary

Checkout URI https://github.com/ctu-vras/ros-utils.git
VCS Type git
VCS Version master
Last Updated 2022-09-21
Dev Status DEVELOPED
CI status No Continuous Integration
Released RELEASED
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

A Czech-army knife for ROS code written in Python.

Additional Links

Maintainers

  • Martin Pecka

Authors

  • Martin Pecka

cras_py_common

A Czech-army knife for ROS code written in Python.

The aim of this package is to provide some missing utility functions to rospy. Using libraries from this package, you should be able to write more efficient, safer and less error-prone code without much boilerplate. As this package is intended to handle a lot of the boring code for you "behind the scenes", ubiquitous effort was put into unit-testing everything, so that you can rely on the provided code without the usual fear whether it works or not.

This readme shortly introduces the provided libraries. Detailed documentation can be found in the comments in code and in the API docs. Examples of usage can be found in the dependent packages from ros-utils, and in the unit tests.

Parts of this package were used by team CTU-CRAS-Norlab in DARPA Subterranean Challenge.

Support and Build Status

This package is supported on Melodic and Noetic until their End of Life (and maybe later). It is occasionally tested with non-default GCC versions like Melodic+GCC8 or Noetic+GCC11.

Development versions: CI Dev melodic Dev noetic ubuntu Dev noetic debian

Release jobs Melodic Melodic version: Bin melodic-amd64 Bin melodic-arm64 Bin melodic-armhf

Release jobs Noetic Noetic version: Bin ubuntu noetic-amd64 Bin ubuntu noetic-arm64 Bin ubuntu noetic-armhf Bin debian noetic-amd64 Bin debian noetic-arm64

List of Provided Modules

The most useful functions and classes from these modules are available directly from the cras package, i.e.

from cras import to_str
# instead of
from cras.string_utils import to_str

  • geometry_utils: Finally THE module providing easy and foolproof conversion between quaternions and roll/pitch/yaw notation.
  • log_utils: Some convenience for rospy logging. This is mostly an internal library, but it can be used elsewhere, too.
  • param_utils: Utilities for type-safe, easy, unified and configurable access to ROS parameters. See below for examples and more details.
  • string_utils: Universal to_str() that converts almost anything to a sensible string.
  • test_utils: Utilities for writing unit tests, e.g. a tool that can "read" what was written by rospy.loginfo().
  • time_utils: Conversions between rospy.Rate and frequency. rospy.Rate equality comparison. Min/max time and duration constants.

param_utils: Parameter Reading Helpers

param_utils provide a type-safe, unified and highly configurable interface for reading ROS parameters. Read a numpy matrix, vector of unsigned ints, rospy.Duration or geometry_msgs.msg.Vector3 directly without the need to write a single line of conversion code or value checking. Type of the value to read is automatically determined either from the provided default value, or from result_type parameter.

Example usage:

from cras import get_param, GetParamException
from geometry_msgs.msg import Vector3

# read array of 3 doubles from parameter server into a geometry_msgs.msg.Vector3, defaulting to the specified vector if not set.
gravity = get_param("gravity", Vector3(0, 0, -9.81), "m.s^-2")

# required parameters are specified by not having a default; if you still want conversion to some type, use result_type
try:
    gravity2 = get_param("gravity", "m.s^-2", result_type=Vector3)
except GetParamException as e:
    # the exception is raised if the required parameter is not set
    # e.info contains details about the unsuccessful lookup
    print(e.info.message)

You can also configure the parameter lookup behavior, e.g. to throw exception if the value cannot be converted to the requested type (normally, the default value is used in such case):

# will throw GetParamException if int_param has a value different from 0 and 1
from cras import get_param
bool_param = get_param("int_param", False, throw_if_convert_fails=True)

Finally, there is also a more verbose version of get_param() that tells more about how the lookup went:

from cras import get_param_verbose
res = get_param_verbose("int", 0)
int_param = res.value
was_default_used = res.info.default_used

CHANGELOG

Changelog for package cras_py_common

2.0.2 (2022-08-29)

  • De-flake throttle test and enable catkin_lint when it has chance to run correctly.
  • Added website links.
  • Add linters and licenses.
  • Contributors: Martin Pecka

2.0.1 (2022-08-26)

  • Moved hack_frame_id from cras_py_common to cras_topic_tools.

1.0.0

  • Added improved static_transform_broadcaster for Python.
  • Added hack_frame_id
  • Added cras_py_common
  • Contributors: Martin Pecka

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged cras_py_common at answers.ros.org

No version for distro ardent. Known supported distros are highlighted in the buttons above.
No version for distro bouncy. Known supported distros are highlighted in the buttons above.
No version for distro crystal. Known supported distros are highlighted in the buttons above.
No version for distro eloquent. Known supported distros are highlighted in the buttons above.
No version for distro dashing. Known supported distros are highlighted in the buttons above.
No version for distro lunar. Known supported distros are highlighted in the buttons above.
No version for distro jade. Known supported distros are highlighted in the buttons above.
No version for distro indigo. Known supported distros are highlighted in the buttons above.
No version for distro hydro. Known supported distros are highlighted in the buttons above.
No version for distro kinetic. Known supported distros are highlighted in the buttons above.