Issue when calling custom ROS Action Type

Hi, I am working on the actions_quiz and am running into the following issue.

I have created an .action file called CustomActionMsg.action inside the src file of my package actions_quiz. I have edited the .xml and Cmake per the instructions so they look like:

`<?xml version="1.0"?>

actions_quiz
0.0.0
The actions_quiz package

user
TODO

<buildtool_depend>catkin</buildtool_depend>
<build_depend>actionlib</build_depend>
<build_depend>actionlib_msgs</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_export_depend>actionlib</build_export_depend>
<build_export_depend>actionlib_msgs</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<exec_depend>actionlib</exec_depend>
<exec_depend>actionlib_msgs</exec_depend>
<exec_depend>rospy</exec_depend>

`

and

`cmake_minimum_required(VERSION 2.8.3)
project(actions_quiz)

find_package(catkin REQUIRED COMPONENTS
std_msgs
actionlib_msgs
)

add_action_files(
FILES
Name.action
)

generate_messages(
DEPENDENCIES
std_msgs actionlib_msgs
)

catkin_package(
CATKIN_DEPENDS rospy
)

include_directories(
${catkin_INCLUDE_DIRS}
)`

I then did a catkin_make and source devel/setup.bash. When I run a rostopic list, I can see my action. I import the necessary functions in the .py file with

from actions_quiz.msg import CustomActionMsgAction, CustomActionMsgResult, CustomActionMsgFeedback

I then try to call it through the terminal with:

rostopic pub /action_custom_msg_as/goal actions_quiz/CustomActionMsgGoal "goal: 'hello'"

but I am receiving the error:

[WARN] [1564713052.516346]: Could not process inbound connection: topic types do not match: [actions_quiz/CustomActionMsgActionGoal] vs. [actions_quiz/CustomActionMsgGoal]{'message_definition': "

Please advise.

Hi @nrjbs87,

Here is a hint from the notebook:

You must be aware that the name of the messages (the class) used in the Python code are called FibonacciGoal , FibonacciResult , and FibonacciFeedback , while the name of the messages used in the topics are called FibonacciActionGoal , FibonacciActionResult , and FibonacciActionFeedback .

Therefore, when you are sending the goal from the terminal (shell), your goal name should be CustomActionMsgActionGoal. If creating it from Python code, it would be CustomActionMsgGoal.

1 Like

Thank you! this fixed my problem.

1 Like