Hi, I’m finishing making the client for the project’s action server, and when I run to start the action server with rosrun actionlib_tools axclient.py /my_action(which would be the name I want to give my action server), I get throws an error that is the following:
here I leave the code that I made
#! /usr/bin/env python
# ---------------------IMPORTACION DE MODULOS Y MENSAJES--------------------------
from scan_test.msg import OdomRecordAction,OdomRecordGoal, OdomRecordResult, OdomRecordFeedback
from nav_msgs.msg import Odometry
#----------------------DECLARACION DE OBJETOS Y INICIALIZACION DE VARIABLES-----------------
goal = OdomRecordGoal()
odom = Odometry()
feedback = OdomRecordFeedback()
result = OdomRecordResult()
goal.meter = 10
feedback.current_total = 0
result.list_of_odoms = 
result.list_of_odoms.append([msg.pose.pose.position.x, msg.pose.pose.position.y, msg.pose.pose.position.z])
if msg.pose.pose.position.x not in result.list_of_odoms:
feedback.current_total += 1
print('Cantidad de metros recorridos: ', feedback.current_total)
rospy.Subscriber('/odom', Odometry, callback)
client = actionlib.SimpleActionClient('/my_action', OdomRecordAction)
if feedback.current_total == goal.meter:
print('[Result] State: %d'%(client.get_state()))
Hi @FranROS99 ,
I believe you are working on the course project (rosject) for ROS Basics in 5 Days with Python.
From my understanding of the project instructions, you would not require a subscriber for Odometry in the action client program.
Are you sure you are having your
/my_action service server initialized and running? Because running a client without service will not work or give error (stating the service is not available or something similar).
You need to assign this to a variable, say
odom_sub = ...
You seem a little confused (I guess).
Will the server return the response immediately once
current_total == goal.meter?
I think you must use
>= rather than
==. You have declared
goal.meter = 10 which is a rounded (whole) number. While simulation it could be something like 9.89 and then jump straight to 10.02. So the value will never be strictly 10.
This line, I believe, must be on the server side.
The client has only three functions:
0. Wait for server to become active/online. (This is one of the important steps for action client to work, so step 0).
- Call the goal by sending the goal to the server.
- Keep getting feedback messages.
- Report the result when complete.
The errors you are getting seems to be associated with
axclient.py. I believe from the last line of the error that the Goal message that it receives seems to be a
When you are using the
axclient.py program, are you typing in
10 in the textbox and clicking on
send goal button? Probably you are just clicking on the
send goal button without filling in the
Could you please share a picture of how you are using
axclient.py? That would help find the cause of your error.
Also could you please share your action message file contents?
Yes, now I send you, with respect to axclient.py I use it like this:
and the structure of the action message:
Hi @FranROS99 ,
This is the command with which you start
axclient.py from terminal.
I would like to see what you do with the
axclient GUI. Please send me a picture of your axclient GUI before you click “Send Goal” button on the GUI.
You can directly specify
int32 datatype as
int32 meter. You do not have to define it as
Also, it would be better (and easy) if you make
float32 and not
Subsequently, you can make
goal.meter = 10.0 in your code to reflect the change from
float. Unlike C++, Python will intrinsically convert
float when required.
And in the axclient GUI, you can send the goal as