Skip to content

Commit

Permalink
DOCS-2949: Fix mismapped methods (#3651)
Browse files Browse the repository at this point in the history
Co-authored-by: Naomi Pentrel <[email protected]>
  • Loading branch information
JessamyT and npentrel authored Nov 5, 2024
1 parent 373a8da commit d88dc76
Show file tree
Hide file tree
Showing 9 changed files with 183 additions and 156 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/sdk_protos_map.csv
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@ board,GetPWM,Yes,get_pwm,PWM,pwm
board,SetPWM,Yes,set_pwm,SetPWM,setPwm
board,PWMFrequency,Yes,get_pwm_frequency,PWMFreq,pwmFrequency
board,SetPWMFrequency,Yes,set_pwm_frequency,SetPWMFreq,setPwmFrequency
board,AnalogByName,No,analog_by_name,AnalogByName,analogReaderValue
## HACK: Omitting PySDK: write_analog, currently borked: https://python.viam.dev/autoapi/viam/components/board/client/index.html#viam.components.board.client.BoardClient.write_analog
board,Write,Yes,,Write,writeAnalog
board,GetDigitalInterruptValue,No,digital_interrupt_by_name,DigitalInterruptByName,,
board,GetDigitalInterruptValue,No,value,Value,digitalInterruptValue
board,ReadAnalogReader,Yes,read,Read,analogReaderValue
## HACK: PySDK: write_analog currently borked; deprecated in favor of write: https://python.viam.dev/autoapi/viam/components/board/client/index.html#viam.components.board.client.BoardClient.write_analog
board,WriteAnalog,Yes,write,Write,writeAnalog
board,StreamTicks,No,stream_ticks,StreamTicks,streamTicks
board,SetPowerMode,No,set_power_mode,SetPowerMode,setPowerMode
board,GetGeometries,No,get_geometries,,
## HACK: Board (python, go) provides additional helper functions, adding 5 pseudo-entries:
board,Read,Yes,read,Read,
board,Value,No,value,Value,digitalInterruptValue
board,AnalogByName,No,analog_by_name,AnalogByName,
board,DigitalInterruptByName,No,digital_interrupt_by_name,DigitalInterruptByName,,
board,GPIOPinByName,No,gpio_pin_by_name,GPIOPinByName,
## HACK: No proto for these (and/or inherited in Go SDK), manually mapping:
board,GetGeometries,No,get_geometries,,
board,Reconfigure,No,,Reconfigure,
board,DoCommand,Yes,do_command,DoCommand,doCommand
board,Name,No,,Name,
Expand Down
4 changes: 2 additions & 2 deletions docs/appendix/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The `errors_only` parameter has been removed from [`get_robot_part_logs()`](/app

{{% changelog date="2024-05-28" color="changed" title="Return type of analog Read" %}}

The board analog API [`Read()`](/appendix/apis/components/board/#read) method now returns an `AnalogValue` struct instead of a single int.
The board analog API [`Read()`](/appendix/apis/components/board/#readanalogreader) method now returns an `AnalogValue` struct instead of a single int.
The struct contains an int representing the value of the reading, min and max range of values, and the precision of the reading.

{{% /changelog %}}
Expand Down Expand Up @@ -144,7 +144,7 @@ detections = await detector.get_detections(cropped_frame)
{{% changelog date="2024-05-08" color="removed" title="WriteAnalog from Go SDK" %}}

The `WriteAnalog()` method has been removed from the Go SDK.
Use [`AnalogByName()`](/appendix/apis/components/board/#analogbyname) followed by [`Write()`](/appendix/apis/components/board/#write) instead.
Use [`AnalogByName()`](/appendix/apis/components/board/#analogbyname) followed by [`Write()`](/appendix/apis/components/board/#writeanalog) instead.

{{% /changelog %}}

Expand Down
12 changes: 6 additions & 6 deletions static/include/components/apis/generated/board-table.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
| [`SetPWM`](/appendix/apis/components/board/#setpwm) | Set the pin's Pulse-width modulation (PWM) duty cycle: a float [`0.0`, `1.0`] indicating the percentage of time the digital signal output of this pin is in the high state (active, >0V) relative to the interval period of the PWM signal (interval period being the mathematical inverse of the PWM frequency). | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`PWMFrequency`](/appendix/apis/components/board/#pwmfrequency) | Get the PWM frequency of the GPIO pin. | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`SetPWMFrequency`](/appendix/apis/components/board/#setpwmfrequency) | Set the pin to the given PWM `frequency` (in Hz). When `frequency` is 0, it will use the board’s default PWM frequency. | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`AnalogByName`](/appendix/apis/components/board/#analogbyname) | Get a configured `Analog` by `name`. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`Write`](/appendix/apis/components/board/#write) | Write an analog value to a pin on the board. | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`GetDigitalInterruptValue`](/appendix/apis/components/board/#getdigitalinterruptvalue) | Get a configured `DigitalInterrupt` by `name`. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`GetDigitalInterruptValue`](/appendix/apis/components/board/#getdigitalinterruptvalue) | Get the current value of a configured digital interrupt. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`ReadAnalogReader`](/appendix/apis/components/board/#readanalogreader) | Read the current integer value of the digital signal output by the ADC. | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`WriteAnalog`](/appendix/apis/components/board/#writeanalog) | Write an analog value to a pin on the board. | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`StreamTicks`](/appendix/apis/components/board/#streamticks) | Start a stream of `DigitalInterrupt` ticks. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`SetPowerMode`](/appendix/apis/components/board/#setpowermode) | Set the board to the indicated `PowerMode`. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`GetGeometries`](/appendix/apis/components/board/#getgeometries) | Get all the geometries associated with the board in its current configuration, in the frame of the board. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`Read`](/appendix/apis/components/board/#read) | Read the current integer value of the digital signal output by the ADC. | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`Value`](/appendix/apis/components/board/#value) | Get the current value of this interrupt. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`AnalogByName`](/appendix/apis/components/board/#analogbyname) | Get a configured `Analog` by `name`. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`DigitalInterruptByName`](/appendix/apis/components/board/#digitalinterruptbyname) | Get a DigitalInterrupt by `name`. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`GPIOPinByName`](/appendix/apis/components/board/#gpiopinbyname) | Get a `GPIOPin` by {{< glossary_tooltip term_id="pin-number" text="pin number" >}}. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`GetGeometries`](/appendix/apis/components/board/#getgeometries) | Get all the geometries associated with the board in its current configuration, in the frame of the board. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`Reconfigure`](/appendix/apis/components/board/#reconfigure) | Reconfigure this resource. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
| [`DoCommand`](/appendix/apis/components/board/#docommand) | Execute model-specific commands that are not otherwise defined by the component API. | <p class="center-text"><i class="fas fa-check" title="yes"></i></p> |
| [`Name`](/appendix/apis/components/board/#name) | Get the name of the digital interrupt. | <p class="center-text"><i class="fas fa-times" title="no"></i></p> |
Expand Down
Loading

0 comments on commit d88dc76

Please sign in to comment.