Class import error

Hi, In basic maths for robotics course, when I am trying to import the class from another turtlebot_moves.py fileimage, it is throwing me an error as shown.

. In the solution however, image is used. What is this * and why can’t I use from turtlebot_moves import TurtlebotMoves here. The same concept was used in python classes chapter in ros in 5 days. Also, I have ensured that both scripts are executable. Thanks

Hello @navjotsinghsodhi52 ,

I’ve been doing some tests and the problem is related to the other import:

from move_triangle import calculate_triangle_parameters

If you remove this import (you’ll need to also move the helper functions to this file) then the import is going to work fine. Doing this:

from turtlebot_moves import *

the * means ‘everything’. So it’s importing everything from this file. I’m not sure though why this method works and importing only the class causes the conflict with the other import. I’ll investigate more about it.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.