MATLAB Answers

Error when running rosgenmsg for control_msgs

12 views (last 30 days)
Bassem Saleh
Bassem Saleh on 9 Feb 2021
Commented: Cam Salzberger on 9 Feb 2021
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 Comment
Bassem Saleh
Bassem Saleh on 9 Feb 2021
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

Sign in to comment.

Answers (1)

Cam Salzberger
Cam Salzberger on 9 Feb 2021
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 Comments
Cam Salzberger
Cam Salzberger on 9 Feb 2021
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

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!