Closed jo-bru closed 3 years ago
I've changed all the discussed parts and updated the FSM, which I added to the README file.
I've run a simple test (subroutine_test()
) with the uArm robot at home (see GIF).
Since the belt conveyor and the slider are too big to easily take home, I could not implement the step_lowlevel driver yet. For now, I haven't implemented the non-volatile backup mechanism yet as it is labeled as an optional issue (see issue #3).
The firmware should be ready to use with further gateway implementations IMO. We may have to optimize the firmware in the future to reduce the latency.
@jo-bru Wonderful, thank you! I'll review the changes this afternoon. Let's discuss the gRPC gateway tomorrow.
This version of the controller firmware is not complete yet, as discussed. This version includes the following changes/implementations:
To be able to handle different sorts of feedback messages, a
ResponseCode
field with the following options was included:DEBUG:
used only for debugging purposeERROR
: used for error handlingACK
: used for acknowledging actions that are not finished yet (used for non-blocking/event-driven mode)DONE
: used for giving feedback on finished actionsDATA
: used for returning data to the gatewayFor handling actions and events on the gateway, the following
ProfileState
s are used to indicate the state of each profile:UNREG
: the profile is created, but not yet registered on the MCUIDLE
: the profile is registered and available for further requestsWAIT
: the profile is waiting for an ACK (blocking state: if a profile is in the WAIT state all profiles of the same MCU are blocked)BUSY
: the profile is waiting for a DONE/DATA (non-blocking state: other profiles are not blocked)To manage all profile registered on the MCU, the
profile_manager.cpp
sub-module was added (#7):in the
registered_profiles[255]
are all registered profiles saved to retrieve information for each profilean existing profile gets simply overwritten
for now, the deletion of profiles is not supported
every successful registration is acknowledged with a DONE feedback message
The following drivers were added/completed (#9):
digital_generic
: functions for reading a digital pin in blocking and non-blocking (event-driven) mode were addedcolor_sensor
: for now, the IIC address of the device is hardcoded, therefore only one color sensor can be used at the same timeultrasonic_sensor
: for now, the measurement is hardcoded (only for testing, as I have no ultrasonic sensor at home)step_lowlevel
: not implemented yet (only skeleton created with the automatic driver initialization)To test the firmware, the following tests were added to the
simple_gateway.py
file:Updating profiles: overwrite profile 2 every 5 loops the change LED color (green <=> blue)
Event handling: create a profile for button A and listen for an event (
read_event_digital()
)Color sensor: get the current measurement of the sensor (only working if the sensor is connected to IIC port => !! wrong label on controller backside: use Digital ports for IIC)
Ultrasonic sensor: get a measurement of the sensor (result is hardcoded as explained before)
The
event_handler()
was added to handle non-blocking requests (#5 ):event_driver_name
function (e.g.event_digital_generic()
)The automatic driver initialization script is completed (#8):