Functions | Variables
rospy_message_converter.message_converter Namespace Reference

Functions

def _convert_from_ros_array (field_type, field_value)
 
def _convert_from_ros_binary (field_type, field_value)
 
def _convert_from_ros_primitive (field_type, field_value)
 
def _convert_from_ros_time (field_type, field_value)
 
def _convert_from_ros_type (field_type, field_value)
 
def _convert_to_ros_array (field_type, list_value)
 
def _convert_to_ros_binary (field_type, field_value)
 
def _convert_to_ros_primitive (field_type, field_value)
 
def _convert_to_ros_time (field_type, field_value)
 
def _convert_to_ros_type (field_type, field_value)
 
def _get_message_fields (message)
 
def _is_field_type_an_array (field_type)
 
def convert_dictionary_to_ros_message (message_type, dictionary, kind='message')
 
def convert_ros_message_to_dictionary (message)
 
def is_ros_binary_type (field_type, field_value)
 

Variables

 list_brackets = re.compile(r'\[[^\]]*\]')
 
bool python3 = True
 
list python_list_types = [list, tuple]
 
list python_string_types = [str]
 
dictionary python_to_ros_type_map
 
 ros_binary_types_regexp = re.compile(r'(uint8|char)\[[^\]]*\]')
 
list ros_header_types = ['Header', 'std_msgs/Header', 'roslib/Header']
 
list ros_primitive_types
 
list ros_time_types = ['time', 'duration']
 

Function Documentation

def rospy_message_converter.message_converter._convert_from_ros_array (   field_type,
  field_value 
)
private

Definition at line 215 of file message_converter.py.

def rospy_message_converter.message_converter._convert_from_ros_binary (   field_type,
  field_value 
)
private

Definition at line 201 of file message_converter.py.

def rospy_message_converter.message_converter._convert_from_ros_primitive (   field_type,
  field_value 
)
private

Definition at line 212 of file message_converter.py.

def rospy_message_converter.message_converter._convert_from_ros_time (   field_type,
  field_value 
)
private

Definition at line 205 of file message_converter.py.

def rospy_message_converter.message_converter._convert_from_ros_type (   field_type,
  field_value 
)
private

Definition at line 168 of file message_converter.py.

def rospy_message_converter.message_converter._convert_to_ros_array (   field_type,
  list_value 
)
private

Definition at line 148 of file message_converter.py.

def rospy_message_converter.message_converter._convert_to_ros_binary (   field_type,
  field_value 
)
private

Definition at line 118 of file message_converter.py.

def rospy_message_converter.message_converter._convert_to_ros_primitive (   field_type,
  field_value 
)
private

Definition at line 143 of file message_converter.py.

def rospy_message_converter.message_converter._convert_to_ros_time (   field_type,
  field_value 
)
private

Definition at line 126 of file message_converter.py.

def rospy_message_converter.message_converter._convert_to_ros_type (   field_type,
  field_value 
)
private

Definition at line 104 of file message_converter.py.

def rospy_message_converter.message_converter._get_message_fields (   message)
private

Definition at line 219 of file message_converter.py.

def rospy_message_converter.message_converter._is_field_type_an_array (   field_type)
private

Definition at line 222 of file message_converter.py.

def rospy_message_converter.message_converter.convert_dictionary_to_ros_message (   message_type,
  dictionary,
  kind = 'message' 
)
Takes in the message type and a Python dictionary and returns a ROS message.

Example:
    message_type = "std_msgs/String"
    dict_message = { "data": "Hello, Robot" }
    ros_message = convert_dictionary_to_ros_message(message_type, dict_message)

    message_type = "std_srvs/SetBool"
    dict_message = { "data": True }
    kind = "request"
    ros_message = convert_dictionary_to_ros_message(message_type, dict_message, kind)

Definition at line 65 of file message_converter.py.

def rospy_message_converter.message_converter.convert_ros_message_to_dictionary (   message)
Takes in a ROS message and returns a Python dictionary.

Example:
    ros_message = std_msgs.msg.String(data="Hello, Robot")
    dict_message = convert_ros_message_to_dictionary(ros_message)

Definition at line 152 of file message_converter.py.

def rospy_message_converter.message_converter.is_ros_binary_type (   field_type,
  field_value 
)
Checks if the field is a binary array one, fixed size or not

is_ros_binary_type("uint8", 42)
>>> False
is_ros_binary_type("uint8[]", [42, 18])
>>> True
is_ros_binary_type("uint8[3]", [42, 18, 21]
>>> True
is_ros_binary_type("char", 42)
>>> False
is_ros_binary_type("char[]", [42, 18])
>>> True
is_ros_binary_type("char[3]", [42, 18, 21]
>>> True

Definition at line 183 of file message_converter.py.

Variable Documentation

rospy_message_converter.message_converter.list_brackets = re.compile(r'\[[^\]]*\]')

Definition at line 63 of file message_converter.py.

bool rospy_message_converter.message_converter.python3 = True

Definition at line 39 of file message_converter.py.

list rospy_message_converter.message_converter.python_list_types = [list, tuple]

Definition at line 54 of file message_converter.py.

list rospy_message_converter.message_converter.python_string_types = [str]

Definition at line 51 of file message_converter.py.

dictionary rospy_message_converter.message_converter.python_to_ros_type_map
Initial value:
1 = {
2  'bool' : ['bool'],
3  'int' : ['int8', 'byte', 'uint8', 'char',
4  'int16', 'uint16', 'int32', 'uint32',
5  'int64', 'uint64', 'float32', 'float64'],
6  'float' : ['float32', 'float64'],
7  'str' : ['string'],
8  'unicode' : ['string'],
9  'long' : ['uint64']
10 }

Definition at line 40 of file message_converter.py.

rospy_message_converter.message_converter.ros_binary_types_regexp = re.compile(r'(uint8|char)\[[^\]]*\]')

Definition at line 61 of file message_converter.py.

list rospy_message_converter.message_converter.ros_header_types = ['Header', 'std_msgs/Header', 'roslib/Header']

Definition at line 60 of file message_converter.py.

list rospy_message_converter.message_converter.ros_primitive_types
Initial value:
1 = ['bool', 'byte', 'char', 'int8', 'uint8', 'int16',
2  'uint16', 'int32', 'uint32', 'int64', 'uint64',
3  'float32', 'float64', 'string']

Definition at line 57 of file message_converter.py.

list rospy_message_converter.message_converter.ros_time_types = ['time', 'duration']

Definition at line 56 of file message_converter.py.



rospy_message_converter
Author(s): Brandon Alexander
autogenerated on Tue May 7 2019 03:17:53