Messages - sensors#

This package contains messages that are used to represent sensor data and sensors’ state. Sensors include, cameras, range finders, IMUs, temperature sensors, etc.

AngularVelocities#

This message represents angular velocities with respect to a 3D reference frame.

pydantic model duckietown_messages.sensors.angular_velocities.AngularVelocities#

Show JSON schema
{
   "title": "AngularVelocities",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "x": {
         "title": "X",
         "description": "Angular velocities about the x axis [rad/s]",
         "type": "number"
      },
      "y": {
         "title": "Y",
         "description": "Angular velocities about the y axis [rad/s]",
         "type": "number"
      },
      "z": {
         "title": "Z",
         "description": "Angular velocities about the z axis [rad/s]",
         "type": "number"
      }
   },
   "required": [
      "x",
      "y",
      "z"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field x: float [Required]#

Angular velocities about the x axis [rad/s]

field y: float [Required]#

Angular velocities about the y axis [rad/s]

field z: float [Required]#

Angular velocities about the z axis [rad/s]

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#

ButtonEvent#

This message represents an event generated by the press of a button.

pydantic model duckietown_messages.sensors.button_event.ButtonEvent#

Show JSON schema
{
   "title": "ButtonEvent",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "type": {
         "description": "Type of the event",
         "allOf": [
            {
               "$ref": "#/definitions/InteractionEvent"
            }
         ]
      }
   },
   "required": [
      "type"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      },
      "InteractionEvent": {
         "title": "InteractionEvent",
         "description": "An enumeration.",
         "enum": [
            0,
            1,
            3,
            10
         ],
         "type": "integer"
      }
   }
}

Fields
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field type: duckietown_messages.sensors.button_event.InteractionEvent [Required]#

Type of the event

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#

Camera#

This message describes the properties of a camera.

pydantic model duckietown_messages.sensors.camera.Camera#

Show JSON schema
{
   "title": "Camera",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "name": {
         "title": "Name",
         "description": "The name of the sensor",
         "type": "string"
      },
      "type": {
         "title": "Type",
         "description": "The type of the sensor",
         "type": "string"
      },
      "simulated": {
         "title": "Simulated",
         "description": "Whether the sensor is simulated",
         "type": "boolean"
      },
      "description": {
         "title": "Description",
         "description": "A detailed description of the sensor",
         "type": "string"
      },
      "frame_id": {
         "title": "Frame Id",
         "description": "The frame id of the sensor",
         "type": "string"
      },
      "frequency": {
         "title": "Frequency",
         "description": "The (expected) frequency of the sensor",
         "type": "number"
      },
      "maker": {
         "title": "Maker",
         "description": "The maker of the sensor",
         "type": "string"
      },
      "model": {
         "title": "Model",
         "description": "The model of the sensor",
         "type": "string"
      },
      "width": {
         "title": "Width",
         "description": "Width of the image",
         "minimum": 0,
         "type": "integer"
      },
      "height": {
         "title": "Height",
         "description": "Height of the image",
         "minimum": 0,
         "type": "integer"
      },
      "fov": {
         "title": "Fov",
         "description": "Field of view of the camera in radians",
         "minimum": 0,
         "type": "number"
      }
   },
   "required": [
      "name",
      "type",
      "simulated",
      "width",
      "height",
      "fov"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field width: int [Required]#

Width of the image

Constraints
  • minimum = 0

field height: int [Required]#

Height of the image

Constraints
  • minimum = 0

field fov: float [Required]#

Field of view of the camera in radians

Constraints
  • minimum = 0

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field name: str [Required]#

The name of the sensor

field type: str [Required]#

The type of the sensor

field simulated: bool [Required]#

Whether the sensor is simulated

field description: Optional[str] = None#

A detailed description of the sensor

field frame_id: Optional[str] = None#

The frame id of the sensor

field frequency: Optional[float] = None#

The (expected) frequency of the sensor

field maker: Optional[str] = None#

The maker of the sensor

field model: Optional[str] = None#

The model of the sensor

CompressedImage#

This message represents a compressed image.

pydantic model duckietown_messages.sensors.compressed_image.CompressedImage#

Show JSON schema
{
   "title": "CompressedImage",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "format": {
         "title": "Format",
         "description": "The format of the image data",
         "enum": [
            "jpeg",
            "png"
         ],
         "type": "string"
      },
      "data": {
         "title": "Data",
         "description": "The compressed image data",
         "type": "string",
         "format": "binary"
      }
   },
   "required": [
      "format",
      "data"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field format: Literal['jpeg', 'png'] [Required]#

The format of the image data

field data: bytes [Required]#

The compressed image data

classmethod from_rgb(im: numpy.ndarray, encoding: Literal['jpeg', 'png'], header: duckietown_messages.standard.header.Header) duckietown_messages.sensors.compressed_image.CompressedImage#
as_array() numpy.ndarray#
to_rgb() numpy.ndarray#
to_mono8() numpy.ndarray#
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#

Image#

This message represents a raw (uncompressed) image.

pydantic model duckietown_messages.sensors.image.Image#

Show JSON schema
{
   "title": "Image",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "width": {
         "title": "Width",
         "description": "Width of the image",
         "minimum": 0,
         "type": "integer"
      },
      "height": {
         "title": "Height",
         "description": "Height of the image",
         "minimum": 0,
         "type": "integer"
      },
      "encoding": {
         "title": "Encoding",
         "description": "The encoding of the pixels",
         "enum": [
            "rgb8",
            "rgba8",
            "bgr8",
            "bgra8",
            "mono1",
            "mono8",
            "mono16"
         ],
         "type": "string"
      },
      "step": {
         "title": "Step",
         "description": "Full row length in bytes",
         "minimum": 0,
         "type": "integer"
      },
      "data": {
         "title": "Data",
         "description": "Pixel data. Size must be (step * rows)",
         "type": "string",
         "format": "binary"
      },
      "is_bigendian": {
         "title": "Is Bigendian",
         "description": "Is the data bigendian?",
         "type": "boolean"
      }
   },
   "required": [
      "width",
      "height",
      "encoding",
      "step",
      "data",
      "is_bigendian"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field width: int [Required]#

Width of the image

Constraints
  • minimum = 0

field height: int [Required]#

Height of the image

Constraints
  • minimum = 0

field encoding: Literal['rgb8', 'rgba8', 'bgr8', 'bgra8', 'mono1', 'mono8', 'mono16'] [Required]#

The encoding of the pixels

field step: int [Required]#

Full row length in bytes

Constraints
  • minimum = 0

field data: bytes [Required]#

Pixel data. Size must be (step * rows)

field is_bigendian: bool [Required]#

Is the data bigendian?

classmethod from_np(im: numpy.ndarray, encoding: Literal['rgb8', 'rgba8', 'bgr8', 'bgra8', 'mono1', 'mono8', 'mono16'], header: duckietown_messages.standard.header.Header = None) duckietown_messages.sensors.image.Image#
classmethod from_rgb(im: numpy.ndarray, header: duckietown_messages.standard.header.Header = None) duckietown_messages.sensors.image.Image#
classmethod from_rgba(im: numpy.ndarray, header: duckietown_messages.standard.header.Header = None) duckietown_messages.sensors.image.Image#
classmethod from_mono8(im: numpy.ndarray, header: duckietown_messages.standard.header.Header = None) duckietown_messages.sensors.image.Image#
classmethod from_mono1(im: numpy.ndarray, header: duckietown_messages.standard.header.Header = None) duckietown_messages.sensors.image.Image#
as_array() numpy.ndarray#
as_rgb() numpy.ndarray#
as_rgba() numpy.ndarray#
as_mono8() numpy.ndarray#
as_mono1() numpy.ndarray#
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#

LinearAccelerations#

This message represents linear accelerations with respect to a 3D reference frame.

pydantic model duckietown_messages.sensors.linear_accelerations.LinearAccelerations#

Show JSON schema
{
   "title": "LinearAccelerations",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "x": {
         "title": "X",
         "description": "Linear acceleration along the x axis",
         "type": "number"
      },
      "y": {
         "title": "Y",
         "description": "Linear acceleration along the y axis",
         "type": "number"
      },
      "z": {
         "title": "Z",
         "description": "Linear acceleration along the z axis",
         "type": "number"
      }
   },
   "required": [
      "x",
      "y",
      "z"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field x: float [Required]#

Linear acceleration along the x axis

field y: float [Required]#

Linear acceleration along the y axis

field z: float [Required]#

Linear acceleration along the z axis

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#

Range#

This message represents a range measurement.

pydantic model duckietown_messages.sensors.range.Range#

Show JSON schema
{
   "title": "Range",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "data": {
         "title": "Data",
         "description": "Measured distance (meters, null if out-of-range)",
         "minimum": 0,
         "type": "number"
      }
   },
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field data: Optional[float] = None#

Measured distance (meters, null if out-of-range)

Constraints
  • minimum = 0

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#

RangeFinder#

This message describes the properties of a range finder sensor.

pydantic model duckietown_messages.sensors.range_finder.RangeFinder#

Show JSON schema
{
   "title": "RangeFinder",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "name": {
         "title": "Name",
         "description": "The name of the sensor",
         "type": "string"
      },
      "type": {
         "title": "Type",
         "description": "The type of the sensor",
         "type": "string"
      },
      "simulated": {
         "title": "Simulated",
         "description": "Whether the sensor is simulated",
         "type": "boolean"
      },
      "description": {
         "title": "Description",
         "description": "A detailed description of the sensor",
         "type": "string"
      },
      "frame_id": {
         "title": "Frame Id",
         "description": "The frame id of the sensor",
         "type": "string"
      },
      "frequency": {
         "title": "Frequency",
         "description": "The (expected) frequency of the sensor",
         "type": "number"
      },
      "maker": {
         "title": "Maker",
         "description": "The maker of the sensor",
         "type": "string"
      },
      "model": {
         "title": "Model",
         "description": "The model of the sensor",
         "type": "string"
      },
      "fov": {
         "title": "Fov",
         "description": "The size of the arc in randians. 0 corresponds to an ideal beam along the x-axis.",
         "type": "number"
      },
      "minimum": {
         "title": "Minimum",
         "description": "Minimum range value (meters)",
         "type": "number"
      },
      "maximum": {
         "title": "Maximum",
         "description": "Maximum range value (meters)",
         "type": "number"
      }
   },
   "required": [
      "name",
      "type",
      "simulated",
      "fov",
      "minimum",
      "maximum"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field fov: float [Required]#

The size of the arc in randians. 0 corresponds to an ideal beam along the x-axis.

field minimum: float [Required]#

Minimum range value (meters)

field maximum: float [Required]#

Maximum range value (meters)

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#
field header: Header [Optional]#

Auto-generated header

field name: str [Required]#

The name of the sensor

field type: str [Required]#

The type of the sensor

field simulated: bool [Required]#

Whether the sensor is simulated

field description: Optional[str] = None#

A detailed description of the sensor

field frame_id: Optional[str] = None#

The frame id of the sensor

field frequency: Optional[float] = None#

The (expected) frequency of the sensor

field maker: Optional[str] = None#

The maker of the sensor

field model: Optional[str] = None#

The model of the sensor

Temperature#

This message represents a measured temperature.

pydantic model duckietown_messages.sensors.temperature.Temperature#

Show JSON schema
{
   "title": "Temperature",
   "type": "object",
   "properties": {
      "header": {
         "title": "Header",
         "description": "Auto-generated header",
         "allOf": [
            {
               "$ref": "#/definitions/Header"
            }
         ]
      },
      "data": {
         "title": "Data",
         "description": "Measured temperature (degrees Celsius)",
         "type": "number"
      }
   },
   "required": [
      "data"
   ],
   "definitions": {
      "Header": {
         "title": "Header",
         "type": "object",
         "properties": {
            "version": {
               "title": "Version",
               "description": "Version of the message this header is attached to",
               "default": "1.0",
               "pattern": "^[0-9]+\\.[0-9]+(\\.[0-9]+)?$",
               "example": "0.1.3",
               "type": "string"
            },
            "frame": {
               "title": "Frame",
               "description": "Reference frame this data is captured in",
               "type": "string"
            },
            "txt": {
               "title": "Txt",
               "description": "Auxiliary data attached to the message",
               "type": "object"
            }
         }
      }
   }
}

Fields
field header: duckietown_messages.standard.header.Header [Optional]#

Auto-generated header

field data: float [Required]#

Measured temperature (degrees Celsius)

classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) Model#

Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data. Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values

copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns

new model instance

dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

classmethod from_orm(obj: Any) Model#
classmethod from_rawdata(rd: dtps_http.structures.RawData) duckietown_messages.base.BaseMessage#
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Optional[Callable[[Any], Any]] = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

classmethod parse_file(path: Union[str, pathlib.Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod parse_obj(obj: Any) Model#
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: pydantic.parse.Protocol = None, allow_pickle: bool = False) Model#
classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') DictStrAny#
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) unicode#
to_rawdata() dtps_http.structures.RawData#
classmethod update_forward_refs(**localns: Any) None#

Try to update ForwardRefs on fields based on this Model, globalns and localns.

classmethod validate(value: Any) Model#