Failing to import message type

asked 2020-05-12 05:36:19 -0600

lavnir gravatar image

updated 2020-05-12 06:35:31 -0600

gvdhoorn gravatar image


I'm trying to import a message type in python and I get the error "cannot import name errorsInfo", however, the message definition is already used in a cpp node and it appears in rosmsg list. I have checked the permission of the file and they are fine. The only thing that comes to my mind is that something needs to be done when a message definition depends on another custom message but I could not find the solution to my problem. Any clues?

EDIT: Provide code and error

Information in the terminal:

ImportError: cannot import name errorsInfo

Importing statement:

from lpv_mpc.msg import errorsInfo

Message definition

simulatorStates[] err
float32[] rmse

being simulatorStates a custom message, which was compiled properly. If I try to open the log file containing the error description it's empty, so I don't have any extra information. The path at which the msg files is located is also correct.

Thank you, Best regards

edit retag flag offensive close merge delete



We cannot help you unless you show a verbatim copy of your import statements and a verbatim copy of the error message.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-12 05:53:25 -0600 )edit

Can you show what ls -al $(rospack find lpv_mpc)/msg outputs?

Is errorsInfo the filename? ROS messages / services / action typically use CamelCase, so I'm wondering whether it should not be ErrorsInfo instead.

gvdhoorn gravatar image gvdhoorn  ( 2020-05-12 07:06:24 -0600 )edit