No version for distro humble showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro jazzy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro kilted showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro rolling showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro ardent showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro bouncy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro crystal showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro eloquent showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro dashing showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro galactic showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro foxy showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro iron showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
jade

Package Summary

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

Repository Summary

Checkout URI https://github.com/baalexander/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Dependant Packages

No known dependants.

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
indigo

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

No version for distro hydro showing lunar. Known supported distros are highlighted in the buttons above.
Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
lunar

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
kinetic

Package Summary

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

Repository Summary

Checkout URI https://github.com/uos/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
melodic

Package Summary

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

Repository Summary

Checkout URI https://github.com/DFKI-NI/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange

Package symbol

rospy_message_converter package from rospy_message_converter repo

rospy_message_converter

ROS Distro
noetic

Package Summary

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

Repository Summary

Checkout URI https://github.com/DFKI-NI/rospy_message_converter.git
VCS Type git
VCS Version master
Last Updated 2024-04-26
Dev Status MAINTAINED
Released RELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Package Description

Converts between Python dictionaries and JSON to rospy messages.

Additional Links

Maintainers

  • Martin Günther

Authors

  • Brandon Alexander

rospy_message_converter

Rospy_message_converter is a lightweight ROS package and Python library to convert from Python dictionaries and JSON messages to rospy messages, and vice versa.

ROS 1 and ROS 2 branches

ROS 1 users should use the master branch. ROS 2 users should use the appropriate branch for their distro (foxy/galactic/humble/rolling/…).

Usage

Convert a dictionary to a ROS message

from rospy_message_converter import message_converter
from std_msgs.msg import String
dictionary = { 'data': 'Howdy' }
message = message_converter.convert_dictionary_to_ros_message('std_msgs/String', dictionary)

Convert a ROS message to a dictionary

from rospy_message_converter import message_converter
from std_msgs.msg import String
message = String(data = 'Howdy')
dictionary = message_converter.convert_ros_message_to_dictionary(message)

Convert JSON to a ROS message

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
json_str = '{"data": "Hello"}'
message = json_message_converter.convert_json_to_ros_message('std_msgs/String', json_str)

Convert a ROS message to JSON

from rospy_message_converter import json_message_converter
from std_msgs.msg import String
message = String(data = 'Hello')
json_str = json_message_converter.convert_ros_message_to_json(message)

Test

To run the tests:

catkin_make test

pre-commit Formatting Checks

This repo has a pre-commit check that runs in CI. You can use this locally and set it up to run automatically before you commit something. To install, use pip:

pip3 install --user pre-commit

To run over all the files in the repo manually:

pre-commit run -a

To run pre-commit automatically before committing in the local repo, install the git hooks:

pre-commit install

License

Project is released under the BSD license.

GitHub actions - Continuous Integration

Build Status

ROS Buildfarm

  binary deb source deb devel doc

File truncated at 100 lines see the full file

CHANGELOG

Change Log

0.5.9 (2022-09-12)

  • Fix flake8 errors
  • Re-format code using black
  • package.xml: Add missing build_export_depend
  • Fix EOF and trailing whitespace
  • Add pre-commit config
  • README: Add note about branches
  • pass down log_level to helper functions (#60)
  • Declare file encoding This is necessary on ROS Melodic (Python2), because I have added a non-ASCII character (u umlaut) in my last commit.
  • Add LICENSE file and license headers
  • Contributors: Martin Günther, Yuri Rocha

0.5.8 (2022-03-03)

  • add option to change log level (#58)
  • Contributors: Yuri Rocha

0.5.7 (2021-09-08)

  • Handle None values in dictionary
  • Add tests for None
  • Dockerfile-kinetic: Add --include-eol-distros
  • Contributors: Martin Günther

0.5.6 (2021-03-01)

  • Propagate strict_mode, check_missing_fields in _convert_to_ros_type Previously, _convert_to_ros_type dropped strict_mode and check_missing_fields in nested messages.
  • Add NestedUint8ArrayTestService tests
  • propagate check_types in _convert_to_ros_type (#51) Co-authored-by: Martin Günther <<martin.guenther@dfki.de>>
  • Fix binary_array_as_bytes=False with nested msgs
  • Add param binary_array_as_bytes Closes #45.
  • Contributors: Marc Bosch-Jorge, Martin Günther, Otacon5555

0.5.5 (2020-11-09)

  • Decode strings from ROS messages as UTF8 This makes the python2 behavior equal to python3.

  • python3 only: Validate base64 strings

  • Add bytes to python3 string types This means that [bytes]{.title-ref} will now also be base64-decoded, which fixes the following tests on python3:

    • test_dictionary_with_uint8_array_bytes
    • test_dictionary_with_uint8_array_bytes_unencoded

    * test_dictionary_with_3uint8_array_bytes On python2, [bytes]{.title-ref} is just an alias for [str]{.title-ref}, which is why it worked without this.

  • Fix and add tests

  • Contributors: Martin Günther

0.5.4 (2020-10-13)

  • Avoid numpy dependency
  • Contributors: Martin Günther, betaboon

0.5.3 (2020-08-20)

  • Add check_types parameter to convert_dictionary_to_ros_message (#42)
  • Allow numpy numeric types in numeric fields (#41) Fixes #39.
  • perf: Remove remaining regexes This is only a small speedup of about 1.03x.
  • perf: Avoid regex in _is_field_type_a_primitive_array This makes the function almost 3x faster.
  • perf: Reorder type checks Perform the cheaper checks first. This results in a speedup of about 1.2x.
  • perf: Avoid regex in is_ros_binary_type This makes is_ros_binary_type almost 5x faster and as a result the whole convert_ros_message_to_dictionary function almost 2x faster.
  • Compare types, not type names; improve error message Old error message: TypeError: Wrong type: '1.0' must be float64 New error message: TypeError: Field 'x' has wrong type <type 'numpy.float64'> (valid types: [<type 'int'>, <type 'float'>])
  • Remove unused python_to_ros_type_map
  • added test for convert_dictionary_to_ros_message with int8 array
  • python 3 fix for _convert_to_ros_binary
  • Contributors: Martin Günther, Steffen Rühl

0.5.2 (2020-07-09)

File truncated at 100 lines see the full file

Recent questions tagged rospy_message_converter at Robotics Stack Exchange