How to use rosgenmsg with a filepath on a separate computer?

1 visualización (últimos 30 días)
Theodore Chase
Theodore Chase el 15 de Abr. de 2019
Comentada: Cam Salzberger el 13 de Oct. de 2020
My Setup:
I have created a custom service (.srv in the srv folder of the desired package) on my main machine (Ubuntu 16.04/ ROS Kinetic/ ROS master on this one). I have Matlab on another computer (Windows 10). The windows computer has full connectivity with ros on the linux computer (Matlab can publish and subscribe to topics and call services through the robotics system toolbox).
My Question:
How do I have Matlab call the rosgenmsg(), a function that generates a Matlab object file from .srv or .msg files, with a file path to a package on a separate computer?

Respuestas (1)

Cam Salzberger
Cam Salzberger el 15 de Abr. de 2019
Hey Theodore,
Barring odd situations where you have other computer systems accessible through network paths ro the like, rosgenmsg is designed to work only on the computer from which you run it. It does not actually communicate over or with ROS at all, it simply uses the tools in MATLAB to build the custom messages into MATLAB and Java files necessary to use them with MATLAB. So you would need to get the message packages off of your Linux machine and put them local to your Windows machine in order to run rosgenmsg.
As a side note, if you have multiple machines that have MATLAB on them, you can just build the libraries once, and share them between machines. See the instructions here.
-Cam
  3 comentarios
Ami
Ami el 6 de Oct. de 2020
Hello. If I copy my custom messages package from my linux machine to my Windows 10 PC, will I need to do any other additional steps? Or just supply the package path to rosgenmsg and it would be enough?
Cam Salzberger
Cam Salzberger el 13 de Oct. de 2020
There shouldn't be any platform-specific changes to the message packages, so there should be no need to change anything between platforms. If it worked with rosgenmsg in MATLAB on one platform, it should work on the other.
If you are talking about copying from a downloaded ROS package that wasn't tested with MATLAB, then there may be some changes necessary. Up through R2020a, rosgenmsg depends on the package.xml being in a specific format. In R2020b, you no longer need anything but the correct folder structure and the msg/srv files.
-Cam

Iniciar sesión para comentar.

Categorías

Más información sobre Custom Message Support en Help Center y File Exchange.

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by