ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Invalid Message type: Getting this error for custom action message

asked 2020-06-19 08:12:45 -0500

hrushi19 gravatar image

updated 2020-06-19 11:16:41 -0500

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>
edit retag flag offensive close merge delete

Comments

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!

jojo011111010001 gravatar image jojo011111010001  ( 2020-06-19 19:36:14 -0500 )edit
1

I deleted the build and devel folders, did catkin_make and source devel/setup.bash and it worked. But for some strange reason, it didn't work in other tabs of my terminal

hrushi19 gravatar image hrushi19  ( 2020-06-20 09:00:18 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-04-19 14:37:41 -0500

traemand gravatar image

updated 2021-04-19 14:38:14 -0500

Strange. I had the EXACT same issue, with the same exam (at The Construct). Deleting devel and build, then running catkin_make and source devel/setup.bash fixed it.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2020-06-19 08:12:45 -0500

Seen: 1,528 times

Last updated: Apr 19 '21