Skip to main content

Encoder

The Encoder node reads a quadrature encoder via two digital input channels and publishes count and direction.

Configuration​

encoder:
enabled: true
sensors: ["left_wheel"]
left_wheel:
port_a: 0
port_b: 1
topic: "left_encoder"

Parameters​

ParameterDescription
port_aDIO channel for encoder channel A (range 0 – 21)
port_bDIO channel for encoder channel B (range 0 – 21)
topicTopic name to publish on

Topics​

Published​

TopicTypeDescriptionRate
/<topic>studica_control/EncoderMsgencoder_count (int32) and encoder_direction (string)20 Hz

Service​

Service name: /<name>/encoder_cmd
Type: studica_control/SetData

CommandDescription
get_countRead current tick count
get_directionRead current direction string