Beta8397 / virtual_robot

A 2D robot simulator to help beginners learn Java programming for FTC Robotics
118 stars 182 forks source link

left_motor in config not defined #74

Closed nreynolds2003 closed 3 years ago

nreynolds2003 commented 3 years ago

It is literally what the title says. The application says that it is not defined, using try/catch, and as such, I can't access the code needed to change it. java.lang.IllegalArgumentException, No com.qualcomm.robotcore.hardware.CRServo named back_crservo is found. Please help me define it. Thank you!

jkenney2 commented 3 years ago

@nreynolds2003

I suspect the issue is that you are trying to run an opmode that is not compatible with the robot configuration you have selected. The only robot configuration that has a motor called "left_motor" is the Two-wheeled bot. So if you try to run an op mode meant for that robot, but have some other robot configuration selected (e.g., Mecanum bot), an exception will be thrown. Unfortunately, as you point out, the system doesn't do very well at pointing you to exactly where in the op mode the exception arose. I should look at making that better.

To find out what hardware objects are available in each robot config, just run the app and select a robot config, but don't run an op mode. The telemetry area will then show you all of the hardware configuration entries for that bot.

Let me know if you continue to have problems with this.

nreynolds2003 commented 3 years ago

Alright, thank you for being so quick! Thank you for your help!

On Fri, Jan 15, 2021, 1:06 PM jkenney2 notifications@github.com wrote:

@nreynolds2003 https://github.com/nreynolds2003

I suspect the issue is that you are trying to run an opmode that is not compatible with the robot configuration you have selected. The only robot configuration that has a motor called "left_motor" is the Two-wheeled bot. So if you try to run an op mode meant for that robot, but have some other robot configuration selected (e.g., Mecanum bot), an exception will be thrown. Unfortunately, as you point out, the system doesn't do very well at pointing you to exactly where in the op mode the exception arose. I should look at making that better.

To find out what hardware objects are available in each robot config, just run the app and select a robot config, but don't run an op mode. The telemetry area will then show you all of the hardware configuration entries for that bot.

Let me know if you continue to have problems with this.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Beta8397/virtual_robot/issues/74#issuecomment-761223014, or unsubscribe https://github.com/notifications/unsubscribe-auth/APWRYBNOAYC4AIRWXEGDMGTS2C34VANCNFSM4WEQXU2A .

jkenney2 commented 3 years ago

@nreynolds2003 Just added code to print a stack trace when exceptions are thrown by op mode code, with clickable links to take you to the source of exception.

nreynolds2003 commented 3 years ago

Thank you! This will solve a lot of problems in the future!

On Fri, Jan 15, 2021, 5:52 PM jkenney2 notifications@github.com wrote:

@nreynolds2003 https://github.com/nreynolds2003 Just added code to print a stack trace when exceptions are thrown by op mode code, with clickable links to take you to the source of exception.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Beta8397/virtual_robot/issues/74#issuecomment-761299640, or unsubscribe https://github.com/notifications/unsubscribe-auth/APWRYBPIMZM7C7VBPPBLOOLS2D5PZANCNFSM4WEQXU2A .