Skip to content

ezrassor_keyboard_controller

Tiger Sachse edited this page Sep 25, 2020 · 4 revisions

Summary

The ezrassor_keyboard_controller translates keyboard events (key presses and key releases) into command messages for the EZRASSOR.

Inputs/Outputs

The keyboard mapping is as follows:

← -> move left
↑ -> move forward
↓ -> move backward
→ -> move right

U -> raise front arm
J -> lower front arm
I -> raise back arm
K -> lower back arm

Y -> dig with front drum (rotate forward)
H -> dump from front drum (rotate backward)
O -> dig with back drum (rotate forward)
L -> dump from back drum (rotate backward)

1 -> execute auto-drive routine
2 -> execute auto-dig routine
3 -> execute auto-dump routine
4 -> execute auto-dock routine
5 -> execute full autonomy routine
0 -> cancel any running routine

The following is a list of topic inputs and outputs, with each topic's type shown in brackets:

INPUTS
node <- keyboard events [key presses and key releases]

OUTPUTS
node -> /autonomous_toggles [std_msgs/Int8]
node -> wheel instructions topic configured at launch [geometry_msgs/Twist]
node -> front arm instructions topic configured at launch [std_msgs/Float32]
node -> back arm instructions topic configured at launch [std_msgs/Float32]
node -> front drum instructions topic configured at launch [std_msgs/Float32]
node -> back drum instructions topic configured at launch [std_msgs/Float32]

Launch Files

keyboard_controller.launch

This launch file spins up a single keyboard controller node. This node is configured via arguments at launch which are passed to the node as namespaced ROS parameters. All possible arguments are listed below:

wheel_instructions_topic
The topic that wheel instructions are published to.
front_arm_instructions_topic
The topic that front arm instructions are published to.
back_arm_instructions_topic
The topic that back arm instructions are published to.
front_drum_instructions_topic
The topic that front drum instructions are published to.
back_drum_instructions_topic
The topic that back drum instructions are published to.

Examples

Launch a keyboard controller that publishes to standard topics, then listen to the wheel_instructions_topic for instructions (requires two terminals):

# Launch the keyboard controller in terminal 1.
roslaunch ezrassor_keyboard_controller keyboard_controller.launch \
    wheel_instructions_topic:=wheel_instructions \
    front_arm_instructions_topic:=front_arm_instructions \
    back_arm_instructions_topic:=back_arm_instructions \
    front_drum_instructions_topic:=front_drum_instructions \
    back_drum_instructions_topic:=back_drum_instructions

# Echo the /wheel_instructions topic in terminal 2.
rostopic echo /wheel_instructions

# Press the "WASD" keys and observe the published wheel instructions.

Clone this wiki locally