Skip to content

ezrassor_teleop_actions

Tiger Sachse edited this page Sep 29, 2020 · 11 revisions

Summary

The ezrassor_teleop_actions package allows users to send pre-defined commands to the EZRASSOR. This functionality is useful to simulate real-life teleoperation over an unstable or delayed connection, such as teleoperation between Earth to Mars. The teleop_action_server node processes incoming goals (commands) and sends feedback at each iteration of execution until the goal is achieved or the action is interrupted.

Inputs/Outputs

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

INPUTS
node <- /gazebo/link_states [gazebo/LinkStates]
node <- /teleop_action_server [ezrassor_teleop_msgs/Teleop]

OUTPUTS
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]

Messages

Teleop

This message holds the goal information for the EZRASSOR.

# TeleopGoal
string MOVE_FORWARD_OPERATION=move-forward
string MOVE_BACKWARD_OPERATION=move-backward
string ROTATE_LEFT_OPERATION=rotate-left
string ROTATE_RIGHT_OPERATION=rotate-right
string RAISE_FRONT_ARM_OPERATION=raise-front-arm
string LOWER_FRONT_ARM_OPERATION=lower-front-arm
string RAISE_BACK_ARM_OPERATION=raise-back-arm
string LOWER_BACK_ARM_OPERATION=lower-back-arm
string DUMP_FRONT_DRUM_OPERATION=dump-front-drum
string DIG_FRONT_DRUM_OPERATION=dig-front-drum
string DUMP_BACK_DRUM_OPERATION=dump-back-drum
string DIG_BACK_DRUM_OPERATION=dig-back-drum
string STOP_OPERATION=stop
string operation (any of the above constants)
float64 duration (time in seconds)

# TeleopResult
float64 x (from link states)
float64 y (from link states)

# TeleopFeedback
string heading
float64 x (from link states)
float64 y (from link states)

Scripts

process_actions

This script validates incoming goals from a file, maps them to a valid goal object, then sends each goal to the action server in the correct order.

Launch Files

teleop_action_server.launch

This launch file spins up an action server for a single robot. 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 the actions server like so:

roslaunch ezrassor_teleop_actions teleop_action_server.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

Then send actions from the Python interpreter:

python2

> from ezrassor_teleop_actions import TeleopActionClient
> client = TeleopActionClient()
> actions = ["move-forward 5.0", "move-backward 5.5"]
> client.validate(actions)
> client.send_movement_goal(actions)

Or send actions from file:

rosrun ezrassor_teleop_actions process_actions /path/to/my-actions-file

Example actions file:

# Comments start with the pound sign
move-forward 5.1
move-backward 4.4
dig-front-drum 2.0

Note that you may have to change the namespace of your terminal if you're trying to send commands to an action server that is under a namespace. You can do this by setting the ROS_NAMESPACE variable before you execute your client command like so:

export ROS_NAMESPACE=<insert namespace>