Error when running rosgenmsg for control_msgs

1 次查看(过去 30 天)
Using Matlab 2020a on my macos, unfortunately this is the latest supported on my OS.
So, I have a problem in my ROS messages, so I downloaded "ROS Toolbox interface for ROS Custom Messages" from the adds-on.
When I try to run rosgenmsg on the needed custom messages folder i get the following:
I am in my home folder and the folder is named: control_msgs:
rosgenmsg errors
rosgenmsg control_msgs
I get:
The folder path,
/Users/user/Documents/MATLAB/SupportPackages/R2020a/3P.instrset/roscustommsg-jdk.instrset/jdk/bin,
is invalid or the folder does not exist.
I also tried:
addpath(genpath('/Users/bassemsaleh/Documents/MATLAB/SupportPackages/R2020a/toolbox/ros/supportpackes/roscustommsg/'))
and this didnt work too.
What should be done, been in this for some time, any help would be appreciated
  1 个评论
Bassem Saleh
Bassem Saleh 2021-2-9
I am using 3.7 and this is the output of pyenv:
PythonEnvironment with properties:
Version: "3.7"
Executable: "/usr/local/bin/python3"
Library: "/Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib"
Home: "/Library/Frameworks/Python.framework/Versions/3.7"
Status: NotLoaded
ExecutionMode: InProcess

请先登录,再进行评论。

回答(1 个)

Cam Salzberger
Cam Salzberger 2021-2-9
Hello Bassem,
Based on the error, it seems that the ROS custom message support package did not install properly. I would recommend removing and reinstalling the support package. If the same error occurs, I'd suggest contacting installation technical support to help ensure that the support package is installed properly.
Also, the Python requirement for use with ROS 1 custom messages is only for R2020b+, and would require Python 2.7. ROS 2 custom messages requires Python 3.7, if you choose to use it.
-Cam
  2 个评论
Bassem Saleh
Bassem Saleh 2021-2-9
编辑:Bassem Saleh 2021-2-9
I removed it and reinstalled again, this didnt solve it.
I figured out that he is trying to search for /Users/user/Documents/MATLAB/SupportPackages/R2020a/3P.instrset/roscustommsg-jdk.instrset/jdk/bin/
and this does not exist, so I manually moved the content of JDK to this folder and now get this error:
Checking subfolder "control_msgs" for custom messages.
Building custom message files for the following packages:
control_msgs
ERROR: JAVA_HOME is set to an invalid directory: /Users/user/Documents/MATLAB/SupportPackages/R2020a/3P.instrset/roscustommsg-jdk.instrset/jdk
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
An error occurred while building custom messages. See the full error message above.
Possible reasons for the error:
1. The msg or srv files may have syntax errors.
2. The dependencies on other message packages may not be declared correctly in the
build_depends tags in the package.xml.
3. Messages packages declared as dependencies may not be available.
4. The custom message packages may be missing a build dependency on "message_generation".
See the ROS Custom Messages documentation for more information.
Do you think I need to restart the installation of the Java enviroment? I will contact the installation team too
Cam Salzberger
Cam Salzberger 2021-2-9
Manually moving around files normally installed automatically generally creates other issues. I generally don't recommend it unless you know exactly what is being done.
It's possible that the support package that was downloaded was incomplete or corrupt somehow. I believe that if the support package has already been downloaded, it will not get downloaded again even if you remove and attempt to reinstall the package. The installation team should be able to walk you through how to guarantee a clean installation (if they don't have other recommended steps to try first).
-Cam

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by