Skip to content

Alpheus Actions

Pushkal Katara edited this page Feb 5, 2018 · 3 revisions

The Action Client and Server communicates over ROS, according to the Actionlib-ROS Protocol. This package is implementation of depth and heading servers that executes long-running depth and heading goals that can be preempted. The actionlib package also provides a client interface to send desired depth/heading requests to the server. The Depth/Heading ActionClient and ActionServer communicate via following ROS Action messages.


Subscribers

  1. /imu/HeadingTrue_degree (Published by SpartonCompassIMU):
  • To control the heading and pose of the vehicle.
  • Callback Function: Updates the variable heading_value to maintain the heading or to reach a heading goal.
  1. /pressure (Published by Pressure Sensor):
  • To control the depth of the vehicle.
  • Callback Function: Updates the variable pressure_value to maintain the depth or to reach a depth goal.

Action Messages

Defined Action Messages:

  1. heading.action
float32 heading_setpoint	`
float32 heading_final		 `
float32 heading_error
  1. depth.action
float32 depth_setpoint		 `
float32 depth_final		 `
float32 depth_error	            `

Generated Action Messages:

  1. Heading Action Messages:
* HeadingAction.msg
* HeadingActionGoal.msg
* HeadingActionResult.msg
* HeadingActionFeedback.msg
* HeadingGoal.msg
* HeadingResult.msg
* HeadingFeedback.msg
  1. Depth Action Messages:
* DepthAction.msg
* DepthActionGoal.msg
* DepthActionResult.msg
* DepthActionFeedback.msg
* DepthGoal.msg
* DepthResult.msg
* DepthFeedback.msg

HeadingServer()

Running parallel with ROS environment, HeadingServer receives the goal from heading client and executes a callback which calculates the heading value.

It defines server using actionlib Class SimpleActionServer that subscribes to '/imu/HeadingTrue_degree' (Published by SpartonCompassIMU) to get data about heading and pose of the vehicle. The callback function updates the heading error using heading-setpoint (received from heading action client) to maintain the heading or to reach a heading goal.

HeadingClient()

It defines heading client using SimpleActionClient class of actionlib. The client connects to the HeadingActionServer and further sends the heading goal and receives the outcome from server.

DepthServer()

Running parallel with ROS environment, DepthServer receives the goal from depth client and executes a callback which calculates the depth/pressure value.

It defines server using actionlib Class SimpleActionServer that subscribes to '/pressure' (Published by Pressure Sensor) to get data about the pressure and the depth of the vehicle. The callback function updates the depth error using depth-setpoint (received from DepthActionClient) to reach a depth goal.

DepthClient()

It defines DepthClient using SimpleActionClient class of actionlib. The client connects to the depthActionServer and further sends the depth/pressure goal and receives the outcome from the server.