Input Output Example - RethinkRobotics/sdk-docs GitHub Wiki
The 'input_output' examples provide simple demonstrations of using the DigitalIO and AnalogIO components, in correspondence with the python interfaces included in the 'baxter_interface' code.
The Digital and Analog IO components include most of the buttons and On/Off LEDs on the robot. These sample programs show how to use the python interfaces and provide a demonstration of using the command and status messages of the components. The same components can be used with all the Digital or Analog components found on the API Reference page.
Start the DigitalIO example from an RSDK terminal session using:
$ rosrun baxter_examples digital_io_blink.py
This example will blink the LED on the Left Navigator on and then off while printing the status before and after.
To run the AnalogIO example, use:
$ rosrun baxter_examples analog_io_rampup.py
This example will run the robot's fans (which are Analog Outputs) from 0 to 100 and back down again in increments of 10.
- The DigitalIO messages provide True/False state updates and control over outputs.
- When a component is an output, the state value is the current setting (such as Light == On).
- When a component is an input, the state value is the current sensed state (such as Button Pressed == True).
For common issues specific to using Digital or Analog Inputs or Outputs with Baxter, check out the Troubleshooting page.