Note: This tutorial assumes that you have completed the previous tutorials: writing a simple action client.

Running an Action Client and Server

Description: This tutorial covers running the Fibonacci server and client then visualizing the channel output and node graph.

Tutorial Level: BEGINNER

Viewing the Action Feedback

Start by bringing up the roscore in a new terminal:

$ roscore

In a new terminal, rostopic the feedback channel to see the feedback from the action server:

$ rostopic echo /fibonacci/feedback

While the server is acting on the goal you will see something similar to:

  • ---
    header: 
      seq: 1
      stamp: 1250813676611629000
      frame_id: 
    status: 
      goal_id: 
        stamp: 1250813676611339000
        id: 1250813676611339000
      status: 1
      text: 
    feedback: 
      sequence: (0, 1, 1)
    ---
    header: 
      seq: 2
      stamp: 1250813677611559000
      frame_id: 
    status: 
      goal_id: 
        stamp: 1250813676611339000
        id: 1250813676611339000
      status: 1
      text: 
    feedback: 
      sequence: (0, 1, 1, 2)
    ---
    header: 
      seq: 3
      stamp: 1250813678611635000
      frame_id: 
    status: 
      goal_id: 
        stamp: 1250813676611339000
        id: 1250813676611339000
      status: 1
      text: 
    feedback: 
      sequence: (0, 1, 1, 2, 3)
    ---

Viewing the Action Result

In a new terminal, rostopic the feedback channel to see the feedback from the action server:

$ rostopic echo /fibonacci/result

After the goal is completed you will see something similar to:

  • ---
    header: 
      seq: 1
      stamp: 1250813759950015000
      frame_id: 
    status: 
      goal_id: 
        stamp: 1250813739949752000
        id: 1250813739949752000
      status: 3
      text: 
    result: 
      sequence: (0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946)

Viewing the Action Node Graph

Alternatively you can look at the nodes while the server and client are running:

$ rxgraph

fibonacci_client_server.png

Starting the Client and Server

Start the action server:

$ rosrun learning_actionlib fibonacci_server

When the action has completed it will print out an info message of succeeded.

  • [ INFO] 1251489514.736936000: /fibonacci: Succeeded

And then run the action client:

$ rosrun learning_actionlib fibonacci_client

When the client receives notification of the completion of the goal it will also print out an info message with the result of the action:

  • [ INFO] 1251489514.737339000: Action finished: SUCCEEDED

Wiki: actionlib_tutorials/Tutorials/RunningServerAndClient (last edited 2009-09-11 05:56:04 by MeloneeWise)