Skip to content

IR Obstacle Avoidance Module Support #384

@leandrumartin

Description

@leandrumartin

Support for the IR obstacle avoidance module component.

Component Behavior

The IR obstacle avoidance module detects objects and obstacles within a certain distance using infrared reflection. It outputs a LOW digital signal when an object is detected. Our library should support receiving this signal and outputting it to the display once received.

You can find example circuit diagrams and code at the Sunfounder Raphael Kit documentation. You can use this to help you write the helper class and wire up your components for hardware testing and writing the documentation.

Acceptance Criteria

Helper Class

A helper class is needed to implement the low-level interactions with the component, and the methods that developers will call when using our library.

  • Class is written in the appropriate subfolder of pi4micronaut-utils/src/main/java/com/opensourcewithslu.
  • Class fully implements functionality for the component using GPIO digital input.
  • Class logs all important changes in state and behavior.
  • Class handles errors gracefully and provides helpful error messages.

Controller Class

A controller class is needed to provide an example of how developers can use our helper class. This will be used in our documentation.

  • Class is written in the appropriate subfolder of components/src/main/java/com/opensourcewithslu/components/controllers.
  • The pinout needed for wiring up the component is documented in components/src/main/resources/application.yml, following the template set by the rest of the file.
  • Controller class has appropriately named API endpoints to show off all functionality of the component.

Tests

Software unit tests are needed to verify that the helper class functions correctly.

  • Tests are written using the Java JUnit Jupiter framework in the appropriate subfolder of pi4micronaut-utils/src/test/java/com/opensourcewithslu.
  • Test cases are written to validate all implemented behavior.
  • Tests handle edge cases.
  • Tests validate all cases where a method should fail, and that appropriate error messages are provided.
  • Tests validate that appropriate log messages are sent by each relevant method.
  • All tests pass.

Documentation

  • Documentation is written in written as an AsciiDoc file in the appropriate subfolder of pi4micronaut-utils/src/docs/asciidoc/components.
  • Includes component description, including the basic function of the component and a description of all important features of the component.
  • Provides a complete list of needed components and materials for setting up the breadboard circuit.
  • Provides complete detailed instructions for assembling the breadboard circuit.
  • Includes a circuit diagram.
  • Includes a schematic diagram.
  • Includes the GPIO pinout configuration needed for in the application.yml for the breadboard circuit. This should match the relevant parts of the application.yml file in the components project.
  • Includes (via dynamic linking) the example controller in the components project.

Metadata

Metadata

Labels

New ComponentImplementing new component supportdocumentationImprovements or additions to documentationenhancementNew feature or requestunit-testTo ensure individual components or functions work as intended.

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions