Invalid Message type: Getting this error for custom action message
I have a catkin package path_exam which has action
directory and a RecordOdom.action file in it. I modify my CMakeLists and package.xml file as per ROS Wiki. I run catkin_make, source devel/setup.bash
.
I can see the msg directory inside the devel directory.
Running rosmsg list | grep RecordOdom
path_exam/RecordOdomAction
path_exam/RecordOdomActionFeedback
path_exam/RecordOdomActionGoal
path_exam/RecordOdomActionResult
path_exam/RecordOdomFeedback
path_exam/RecordOdomGoal
path_exam/RecordOdomResult
I also have my action server up and running. Now when I publish, I get the following error:
user:~/catkin_ws/src/path_exam$ rostopic pub /rec_pose_as/goal path_exam/RecordOdomActionGoal
ERROR: invalid message type: path_exam/RecordOdomActionGoal.
If this is a valid message type, perhaps you need to type 'rosmake path_exam'
rosmake path_exam fails for me.
There were similar questions addressed here but none of them solved my problem maybe because the questions were on custom messages and not on custom action message. Would be grateful for some help:
CMakeLists:
cmake_minimum_required(VERSION 2.8.3)
project(path_exam)
find_package(catkin REQUIRED COMPONENTS
rospy
actionlib_msgs
message_generation
std_msgs
geometry_msgs
path_exam
)
add_action_files(
FILES
RecordOdom.action
# Action2.action
)
generate_messages(
DEPENDENCIES
std_msgs # Or other packages containing msgs
actionlib_msgs
geometry_msgs
)
catkin_package(
# INCLUDE_DIRS include
# LIBRARIES path_exam
CATKIN_DEPENDS rospy
actionlib_msgs
)
include_directories(
${catkin_INCLUDE_DIRS}
)
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
Package.xml:
<?xml version="1.0"?>
<package format="2">
<name>path_exam</name>
<version>0.0.0</version>
<description>The path_exam package</description>
<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_depend>message_generation</build_depend>
<build_depend>geometry_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>
<exec_depend>message_generation</exec_depend>
<export>
</export>
</package>
hi, did you manage to find out what was causing the error? I'm facing the same problem today, despite all of my previous custom actions working just fine!
I deleted the build and devel folders, did
catkin_make
andsource devel/setup.bash
and it worked. But for some strange reason, it didn't work in other tabs of my terminal