Announcement

Collapse
No announcement yet.

Consistant Error - "Unable to find hardware left motor" nothing is named left motor

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Consistant Error - "Unable to find hardware left motor" nothing is named left motor

    Hello,

    This is our second year, and again we are a little behind on programming. We have downloaded the new code from GitHub and moved a simple teleop mode into the Team Code files. We have no motor named "left motor", yet it keeps throwing an exception. We have re downloaded a new git hub and have not changed anything and changed motor controllers, and still there is this error. Please help.

  • #2
    Originally posted by FTC10683 View Post
    Hello,

    This is our second year, and again we are a little behind on programming. We have downloaded the new code from GitHub and moved a simple teleop mode into the Team Code files. We have no motor named "left motor", yet it keeps throwing an exception. We have re downloaded a new git hub and have not changed anything and changed motor controllers, and still there is this error. Please help.
    You must be asking the hardware map to find a device with that name somewhere in your code.

    Comment


    • #3
      Originally posted by FTC10683 View Post
      Hello,

      This is our second year, and again we are a little behind on programming. We have downloaded the new code from GitHub and moved a simple teleop mode into the Team Code files. We have no motor named "left motor", yet it keeps throwing an exception. We have re downloaded a new git hub and have not changed anything and changed motor controllers, and still there is this error. Please help.
      If you are copying one of the sample code from the FtcRobotController module to the TeamCode module, you need to make sure to define whatever hardware that sample code is asking. e.g. motors, gyro etc. Or you need to modify the sample code to use your "hardware profile" instead.

      Comment


      • #4
        Originally posted by FTC10683 View Post
        Hello,

        This is our second year, and again we are a little behind on programming. We have downloaded the new code from GitHub and moved a simple teleop mode into the Team Code files. We have no motor named "left motor", yet it keeps throwing an exception. We have re downloaded a new git hub and have not changed anything and changed motor controllers, and still there is this error. Please help.
        Yes, following on from what others have said....

        The "name" of each device on the robot (motor, servo, sensor etc) appears in two places, and these two places MUST agree.

        1) In the configuration file on your robot (you set this up using the Configure Robot menu option)
        2) Your actual opmode.. whenever you do a command line that says: something = hardwareMap.getSomething("device name")

        In your case, the sample opmode you are running MUST have two drive motors defined in it... scan the code, you will see them.. "left motor" and "right motor".
        But, your configuration file does not have these thwo drive motors named in it.

        either:
        1) Edit the Configuration file on your robot to match the opmore
        or
        2) Change the opmode to match the Configuration file on your robot.

        Do you even have a configuration file?

        Comment

        Working...
        X