Classes | Functions | Variables
rosjson Namespace Reference

Classes

class  ROSJSONException
 

Functions

def ros_message_to_json (msg)
 Convert ROS message to JSON representation. More...
 
def value_to_json (v)
 Convert value to JSON representation. More...
 

Variables

dictionary _JSON_ESCAPE = {'\\':r'\\', '"':'\\"', '\b':r'\b', '\f':r'\f', '\n':r'\n', '\r':r'\r', '\t':r'\t'}
 

Function Documentation

def rosjson.ros_message_to_json (   msg)

Convert ROS message to JSON representation.

JSON representation is a simple dictionary of dictionaries, where a dictionary represents a ROS message. Time and duration are represented by their float value in seconds.

Parameters
msgrospy.Message: message instance to convert
Exceptions
ROSJSONExceptionif msg cannot be converted to JSON

Definition at line 88 of file rosjson.py.

def rosjson.value_to_json (   v)

Convert value to JSON representation.

Parameters
vAny: value to convert to JSON. Supported types are Python primitives (str, int, float, long, bool) as well as rospy Message-related types (Message, Time, Duration).
Returns
str: JSON string representation of v
Exceptions
ROSJSONExceptionif msg cannot be converted to JSON

Definition at line 52 of file rosjson.py.

Variable Documentation

dictionary rosjson._JSON_ESCAPE = {'\\':r'\\', '"':'\\"', '\b':r'\b', '\f':r'\f', '\n':r'\n', '\r':r'\r', '\t':r'\t'}
private

Definition at line 46 of file rosjson.py.



rosjson
Author(s): Ken Conley
autogenerated on Mon Jun 10 2019 15:51:17