Skip to content

Terminal Hat

dgitz edited this page Mar 24, 2021 · 8 revisions

Terminal Hat

A Terminal Hat is essentially the "top" hat of a Raspberry Pi that has all terminal pins broken out. It may not even be a real physical "Hat".

Warnings

  • Only 1 Instance of the Terminal Hat should be ran on a device. This is ensured by the following:
    • Only 1 "TerminalHat" defined per device in json configuration.
    • Only launching 1 "hat_node" per device. As the "hat_node" is designed to support multiple hats, this is appropriate.

Features

A Terminal Hat currently supports the following features:

  • 1 Digital Output Port that can be configured with as many digital output pins as needed/available on a Raspberry Pi.
  • 1 Digital Input Port that can be configured with a many as 16 digital input pins that uses interrupts to publish ROS topics.

Configuration

Parameters

  • ChannelName: A user defined string to call the channel. The published/subscribed topic will be of the form: ///
  • PinNumber: The Physical pin number on the device. For the Terminal Hat, this will be 1-40 for the 2x20 Raspberry Pi Connectors.

Sample Configuration

"TerminalHat1": {
 			"Parent": "DevModule1",
 			"Type": "TerminalHat",
 			"Model": "Standard",
 			"Capability": "GPIO",
 			"UseDefaultConfig": false,
 			"Ports": [{
 				"Name": "DigitalOutput",
 				"Type": "DIGITAL",
 				"Direction": "OUTPUT",
 				"Channels": [{
 					"ChannelName": "ChannelA",
 					"Type": "DIGITAL",
 					"Direction": "OUTPUT",
 					"PinNumber": 5,
 					"DefaultValue": 0,
 					"MinValue": 0,
 					"MaxValue": 1
 				}]
 			}, {
 				"Name": "DigitalInput",
 				"Type": "DIGITAL",
 				"Direction": "INPUT",
 				"Channels": [{
 						"ChannelName": "PPS",
 						"Type": "DIGITAL",
 						"Direction": "INPUT",
 						"PinNumber": 7,
 						"DefaultValue": 0,
 						"MinValue": 0,
 						"MaxValue": 1
 					},
 					{
 						"ChannelName": "ChannelB",
 						"Type": "DIGITAL",
 						"Direction": "INPUT",
 						"PinNumber": 31,
 						"DefaultValue": 0,
 						"MinValue": 0,
 						"MaxValue": 1
 					}
 				]
 			}]
              }

Troubleshooting

Clone this wiki locally