Skip to content

HarvardURC/MATE_ROV

Folders and files

NameName
Last commit message
Last commit date

Latest commit

30f7dc3 · Apr 29, 2018

History

51 Commits
Apr 15, 2018
Apr 1, 2018
Nov 10, 2017
Nov 5, 2017
Dec 3, 2017
Oct 5, 2017
Oct 10, 2017
Sep 29, 2017
Apr 1, 2018
Dec 3, 2017
Nov 14, 2017
Apr 2, 2018
Apr 2, 2018
Dec 3, 2017
Nov 11, 2017
Apr 29, 2018
Oct 12, 2017
Oct 12, 2017
Dec 3, 2017
Oct 10, 2017

Repository files navigation

MATE_ROV

Code for The Harvard Undergraduate Robotics Club's MATE ROV team.

The code consist of separate modules that are run on either the ROV or on a ground base. Inter-module communications are orchestrated by the Server (server.py). Modules send messages to the server and subscribe to certain message types. When the server receives a message of a certain type, it forwards it to all the modules that have subscribed to that message type.

Dependencies

  1. Install google protocol buffers for python
  2. Install the DHT22 sensor library

How to run

  1. Execute ./server.py
  2. Execute all of your modules

Adding new modules

  1. If necessary, create a new protocol buffer for your data.
    • Create a new .proto file describing your buffer in the messages folder.
    • Add your new .proto file to the Makefile in the messages folder.
      • Before:
      protobuf: first.proto
          protoc -I=./ --python_out=./ ./first.proto
      • After:
      protobuf: first.proto second.proto
          protoc -I=./ --python_out=./ ./first.proto
          protoc -I=./ --python_out=./ ./second.proto
    • Run the make command in the comm folder.
    • In messages/__init__.py do the following:
      • Import your new compiled buffer.
      • Add a message type enum for your new buffer.
      • Add the new message type and the associated buffer to message_buffers.
      • Example:
        • Before:
        import struct
        from .first_pb2 import FirstMsg
        
        class MsgType(Enum):
            FIRST = 0
        
        message_buffers = {
            MsgType.FIRST: FirstMsg
        }
        
        __all__ = ['MsgType', 'message_buffers', 'FirstMsg']
        • After:
        import struct
        from .first_pb2 import FirstMsg
        from .second_pb2 import SecondMsg
        
        class MsgType(Enum):
            FIRST = 0
            SECOND = 1
        
        message_buffers = {
            MsgType.FIRST: FirstMsg,
            MsgType.SECOND: SecondMsg
        }
        
        __all__ = ['MsgType', 'message_buffers', 'FirstMsg', 'SecondMsg']
  2. Make a new module class that inherits from robomodules.ProtoModule. Look at MockGuiModule.py and MockSensorModule for examples on modules.