Generating ROS Custom Action Service Messages in R2021a

1 次查看(过去 30 天)
My project has a custom message structure for an action service that needs compiling in MATLAB. This works perfectly fine in R2020a using the ROS Custom Message toolbox.
Now I understand R2020b+ has changed things around. I'm currently using R2021a, and with the new version all my custom messages and service messages compile completely fine except custom action service messages. They're basically ignored so I'm unable to create a client to my action service due to the missing custom messages. All other messages seem to work fine.
Has anyone else had this issue? Do I need to make any modifications to my CMakeLists.txt to get the new rosgenmsg() to work? My .action files are in the "action" folder, in the same level as "msg" and "srv" folders.
Here's an excerpt of my CMakeLists.txt in case someone can point out missing dependencies for action servers (snipped irrelevant parts).
cmake_minimum_required(VERSION 3.0.2)
add_compile_options(-std=c++11)
project( ... )
find_package(catkin REQUIRED COMPONENTS
message_generation
roscpp
rospy
std_msgs
geometry_msgs
actionlib_msgs
actionlib
)
find_package(Boost REQUIRED COMPONENTS system)
add_action_files(
FILES
PlanExecute.action
)
generate_messages(
DEPENDENCIES
std_msgs
geometry_msgs
actionlib_msgs
)
catkin_package(
CATKIN_DEPENDS message_runtime actionlib_msgs
DEPENDS Boost
)

采纳的回答

Cam Salzberger
Cam Salzberger 2021-3-17
编辑:Cam Salzberger 2021-9-1
Hello Wesley,
In R2020a and before, custom actions were not officially supported for ROS Toolbox. It's noted in the documentation here:
"ROS actions are not currently supported and will be ignored during the custom message generation."
Unofficially, it seems that actions worked to a certain extent if the package files were created correctly. In R2020b and R2021a, only officially-supported features were included when the custom message workflow was revamped.
Custom actions are available in R2021b.
As an FYI, in R2020b+, there is no need to use a package.xml or CMakeLists.txt file for the custom message folder. Those files are ignored, as MATLAB generates its own based on the dependencies specified within the message definitions.
-Cam
  2 个评论
Mihael Simonic
Mihael Simonic 2021-4-13
Is there any workaround to use old unoffical version for custom actions?
Cam Salzberger
Cam Salzberger 2021-9-1
编辑:Cam Salzberger 2021-9-1
This functionality is availabe in R2021b, which is currently in pre-release state. If you have a license to get the pre-release, you can use it now. Otherwise, it will be available when 21b is fully released.
I've updated my answer accordingly.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Custom Message Support 的更多信息

产品


版本

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by