Delilah asked . 2021-04-02

Updating existing custom message types with rosgenmsg

I am trying to use the Leap Motion ROS package through matlab. The ROS toolbox came preloaded with the following message types related to Leap Motion
 
 
 leap_motion/leap
 leap_motion/leapros
However, these message type relate to version 0.0.4 of the leap motion ros package. The ROS group has since come out with version 0.0.9 that contains the same message names but completely different msg files.
I have tried, but keep failing, when I try to create the custom message package for these message types. Every time I create the package, the created message type refers back to the 0.0.4 format. I have tried removing the leap_motion folder from the matlab toolbox/robotics folder and I have tried also removing the same folder and jar file from the addons folders, but the created package still refers back to the 0.0.4 format. When I look at the .m files created in matlab_gen for this package, the message information does not reflect the .msg files for the newer package.
I also created a package leap_motion_test that contained the exact same msg files and the same package.xml (with the name changed) and ran this through rosgenmsg. This creates the correct message package that relates to 0.0.9. This leads me to believe that there is something in the matlab code that is seeing the existing message types and then alters the way rosgenmsg works.
Can anyone help me with this? It is extremely frustrating. I thought I was onto the right solution by removing the existing packages from matlab. When I run
rosmsg list

the messages types for leap_motion no longer appeared but when I ran the rosgenmsg, the results were incorrect. Is there another place where matlab stores information about its existing headers? Is there someway that I should format the new package so that matlab accepts that it is ok to update it.

matlab , matrix , simulink , robot , robotics

Expert Answer

John Michell answered . 2024-04-26 08:00:54

Sorry that you are having trouble updating the message definition for the leap_motion package. You can replace the builtin definition as follows:
  • Download the leap_motion folder containing the new message definitions. I think you already have this folder. In the remainder of the instructions, I will assume that this leap_motion folder is placed in c:\customrosmsg.
  • Run rosgenmsg on the folder containing the custom message definitions:

 

rosgenmsg c:\customrosmsg
  • Follow the instructions to edit the javaclasspath.txt file. In addition to the JAR file path, you also need to tell MATLAB to use this JAR file instead of the builtin one. Add the "before" token in front of the JAR file file path:

 

<before>
c:\customrosmsg\matlab_gen\jar\leap_motion-0.0.9.jar
  • Restart MATLAB
  • Delete the previously generated MATLAB files and run rosgenmsg again. Now, it should pick up the new definitions:

 

rmdir('c:\customrosmsg\matlab_gen\msggen\+robotics\+ros\+custom\+msggen\+leap_motion', 's')
rosgenmsg c:\customrosmsg
  • You should now be able to use these new message definitions. All references to the leap_motion message types will automatically use this new definition.

 

msg = rosmessage('leap_motion/leapros')


Not satisfied with the answer ?? ASK NOW

Frequently Asked Questions

MATLAB offers tools for real-time AI applications, including Simulink for modeling and simulation. It can be used for developing algorithms and control systems for autonomous vehicles, robots, and other real-time AI systems.

MATLAB Online™ provides access to MATLAB® from your web browser. With MATLAB Online, your files are stored on MATLAB Drive™ and are available wherever you go. MATLAB Drive Connector synchronizes your files between your computers and MATLAB Online, providing offline access and eliminating the need to manually upload or download files. You can also run your files from the convenience of your smartphone or tablet by connecting to MathWorks® Cloud through the MATLAB Mobile™ app.

Yes, MATLAB provides tools and frameworks for deep learning, including the Deep Learning Toolbox. You can use MATLAB for tasks like building and training neural networks, image classification, and natural language processing.

MATLAB and Python are both popular choices for AI development. MATLAB is known for its ease of use in mathematical computations and its extensive toolbox for AI and machine learning. Python, on the other hand, has a vast ecosystem of libraries like TensorFlow and PyTorch. The choice depends on your preferences and project requirements.

You can find support, discussion forums, and a community of MATLAB users on the MATLAB website, Matlansolutions forums, and other AI-related online communities. Remember that MATLAB's capabilities in AI and machine learning continue to evolve, so staying updated with the latest features and resources is essential for effective AI development using MATLAB.

Without any hesitation the answer to this question is NO. The service we offer is 100% legal, legitimate and won't make you a cheater. Read and discover exactly what an essay writing service is and how when used correctly, is a valuable teaching aid and no more akin to cheating than a tutor's 'model essay' or the many published essay guides available from your local book shop. You should use the work as a reference and should not hand over the exact copy of it.

Matlabsolutions.com provides guaranteed satisfaction with a commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been empanelled after extensive research and quality check.

Matlabsolutions.com provides undivided attention to each Matlab assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work done at the best price in industry.