I have team getting this no such attribute error. See image below. Anyone have any ideas. They get it with the brain attached as well.
don’t do v.MotorGroup, just use MotorGroup, it’s not part of the vex module as such
MotorGroup, SmartDrive and DriveTrain are handled in a different way.
what’s with all the use of “v.” anyway ? It’s not really necessary, assume you did
import vex as v
or something.
Thank you for your reply - will have the team try your fixes.
Hi, I am the creator of the code.
The complete code:
import vex as v
brain = v.Brain()
controller = v.Controller()
# Motor definitions
motor_left = v.Motor(v.Ports.PORT19)
motor_left_front = v.Motor(v.Ports.PORT1)
motor_right = v.Motor(v.Ports.PORT3)
motor_right_front = v.Motor(v.Ports.PORT20)
# left_motors = v.MotorGroup(motor_left, motor_left_front)
right_motors = v.MotorGroup(motor_right, motor_right_front) # it raises the error at this line
Thank you for the response.
So just to clarify, despite what the vex stubs would suggest, MotorGroup is really a standalone module. The Python VM we run on the brain actually does all the importing for you, the only reason we have
from vex import *
at the beginning of the vex python project files is to keep the linter/language server happy and indicate errors before downloading.
Thank you very much. I will try this and it makes sense to me.
ah, this is why i’ve been pulling my hair out for over an hour
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.