View unanswered posts | View active topics It is currently Thu May 28, 2015 3:57 am






Reply to topic  [ 7 posts ] 
How to fix NXT motor being powered while Teleop is ready? 
Author Message
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post How to fix NXT motor being powered while Teleop is ready?
Whenever I go to run Teleop in ROBOTC, you have to go from All stopped, to Teleop Ready, to Teleop Running, yeah?

Well, when I click Teleop Running, then the NXT motor powers on and keeps going, straining itself until
I click Teleop Running.

Is there a way to stop this? I don't want to keep straining the motor.

I've already tried to make it so that if the top hat isn't pressed, then it sets the speed to zero. The 0 position on the top is what makes the NXT move into the strained position if it's not controlled.


Mon Jan 12, 2015 12:23 am
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1516
Post Re: How to fix NXT motor being powered while Teleop is ready
BisonBot5209 wrote:
Whenever I go to run Teleop in ROBOTC, you have to go from All stopped, to Teleop Ready, to Teleop Running, yeah?

Well, when I click Teleop Running, then the NXT motor powers on and keeps going, straining itself until
I click Teleop Running.

Is there a way to stop this? I don't want to keep straining the motor.

I've already tried to make it so that if the top hat isn't pressed, then it sets the speed to zero. The 0 position on the top is what makes the NXT move into the strained position if it's not controlled.

I don't understand what you described here. Are you saying you click TeleOp Running without clicking TeleOp Ready?


Mon Jan 12, 2015 3:12 am
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: How to fix NXT motor being powered while Teleop is ready
BisonBot5209 wrote:
Whenever I go to run Teleop in ROBOTC, you have to go from All stopped, to Teleop Ready, to Teleop Running, yeah?

Well, when I click Teleop Running, then the NXT motor powers on and keeps going, straining itself until
I click Teleop Running.

Is there a way to stop this? I don't want to keep straining the motor.

I've already tried to make it so that if the top hat isn't pressed, then it sets the speed to zero. The 0 position on the top is what makes the NXT move into the strained position if it's not controlled.


Does your code have waitForStart()? It seems like ROBOTC will send a zeroed out joystick command to the robot when Teleop Ready is selected, and if your code doesn't have waitForStart, then any code that uses the top hat will think it's being pressed up and cause such behavior.

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Mon Jan 12, 2015 11:45 am
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: How to fix NXT motor being powered while Teleop is ready
MHTS wrote:
BisonBot5209 wrote:
Whenever I go to run Teleop in ROBOTC, you have to go from All stopped, to Teleop Ready, to Teleop Running, yeah?

Well, when I click Teleop Running, then the NXT motor powers on and keeps going, straining itself until
I click Teleop Running.

Is there a way to stop this? I don't want to keep straining the motor.

I've already tried to make it so that if the top hat isn't pressed, then it sets the speed to zero. The 0 position on the top is what makes the NXT move into the strained position if it's not controlled.

I don't understand what you described here. Are you saying you click TeleOp Running without clicking TeleOp Ready?

Yes, it doesn't let me just jump to run Teleop, I have to pass through ready first, then click running. But as I'm transitioning, the motor powers on. Sorry if it was confusing, I'm sure there is a better way of doing it and I just chose the taboo method. Not exactly sure how that part of it works, I'm still new to this.


Mon Jan 12, 2015 1:03 pm
Profile
Rookie

Joined: Sun Jan 04, 2015 8:47 pm
Posts: 23
Post Re: How to fix NXT motor being powered while Teleop is ready
BurningLights wrote:
BisonBot5209 wrote:
Whenever I go to run Teleop in ROBOTC, you have to go from All stopped, to Teleop Ready, to Teleop Running, yeah?

Well, when I click Teleop Running, then the NXT motor powers on and keeps going, straining itself until
I click Teleop Running.

Is there a way to stop this? I don't want to keep straining the motor.

I've already tried to make it so that if the top hat isn't pressed, then it sets the speed to zero. The 0 position on the top is what makes the NXT move into the strained position if it's not controlled.


Does your code have waitForStart()? It seems like ROBOTC will send a zeroed out joystick command to the robot when Teleop Ready is selected, and if your code doesn't have waitForStart, then any code that uses the top hat will think it's being pressed up and cause such behavior.


I never thought teleop would need a wait for start, but now that you mention it sounds like just what I need.

Is it a good idea to generally put waitforstart() at the beginning of all programs, even if a problem like mine isn't present?


Mon Jan 12, 2015 1:05 pm
Profile
Professor
User avatar

Joined: Sat Aug 31, 2013 9:15 am
Posts: 256
Post Re: How to fix NXT motor being powered while Teleop is ready
[quote="BisonBot5209
I never thought teleop would need a wait for start, but now that you mention it sounds like just what I need.

Is it a good idea to generally put waitforstart() at the beginning of all programs, even if a problem like mine isn't present?[/quote]

Yes, waitForStart() should be at the beginning of all FTC programs that will be used in competition. You will fail field inspection if your robot can move between autonomous and teleop.

_________________
FTC Team 6100 Chariots of Fire - Programmer (2012-2013)
FTC Team 7468 Blue Chariots of Fire - Programmer (2013-2014)
FTC Team 7468 Blue Chariots of Fire - Mentor (2014-2015)
Check out our team website at http://bluechariotsoffire.com/.


Mon Jan 12, 2015 7:05 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1516
Post Re: How to fix NXT motor being powered while Teleop is ready
You need to understand the differences between the "TeleOp ready" state and the "TeleOp running" state. When you clicked "TeleOp ready", the TeleOp program is loaded and run. When you click "TeleOp running", it just means it will clear the "StopPgm" Boolean field in the joystick structure. If your teleop program has the waitForStart, that will unblock the waitForStart call. If you don't have a waitForStart call in your teleop program, then "TeleOp ready" and "TeleOp running" states have no difference.


Mon Jan 12, 2015 11:04 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.