Servo Node
This node is responsible for handling the I2C servo that controls the camera panning and tilt. This node is based on I2CNode:
servonode.py
loading...
During startup, this node subscribes to two events:
- servo-execute-sequence - execute a list of CameraCommands
- servo-command - execute a single CameraCommand
Execute Sequence
In response to a servo-execute-sequence event, the method execute_sequence is called:
Execute Sequence
loading...
This code triggers a background thread to run for the given sequence:
Process Sequence
loading...
Each CameraCommand in the sequence is then executed, one after the other using the method execute.
Execute Command
The execute method is call in response to the servo-execute event or during processing a command sequence:
Execute Command
loading...
This method interprets the CameraCommand either by:
- moving the camera to an absolute position through a call to the direct method
- centering the camera through a call to the center method
- moving the camera to a position through a number of steps with a given delay between the steps through a call to the moveTo method
- moving the camera to a relative position through a call to the position method
When updating the camera position, the end position is stored in shared data. This allows the camera to perform relative movements.