View unanswered posts | View active topics It is currently Tue Oct 15, 2019 5:18 am






Reply to topic  [ 2 posts ] 
breakpoints causing errors 
Author Message
Rookie

Joined: Tue Sep 23, 2014 5:15 am
Posts: 7
Post breakpoints causing errors
Hi,

I have 2 problems with breakpoints and the RVW.

Line 1 of my program turns on the left motor, line 2 turns on the right motor. I then put a breakpoint on line 2. When run on an actual NXT, the program turns on the left motor and pauses as expected. When run in the RVW, the program pauses, the motors debugger window says the left motor is turned on, but the robot does not move. Does anyone know why?

The second problem: in basic user mode, you can not access the program debug window. I read on another thread that this window is hidden intentionally and you can get the same functionality by using the play, pause, and reset buttons in the RVW window. However, in my program above, i added a wait command after setting the motor power levels and put a breakpoint on it. With the RVW window play button, the program first pauses on the task main() line, then the breakpoint, then doesn't move, then pauses at the end of the program. Throughout all of this, the robot doesn't move. If I change the user mode to expert, open the program debug window, and use start and resume, the program behaves how I would expect, pausing in the code at the breakpoint and moving the robot forward when the wait command is executed.

Any help in resolving these issues would be greatly appreciated.

Thanks.


Sun Oct 26, 2014 11:28 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Jun 11, 2014 9:59 am
Posts: 115
Post Re: breakpoints causing errors
beefy1875,

Unfortunately break points are not cleanly supported in Robot Virtual Worlds (RVW). The reason being, when ROBOTC hits a break point, it suspends the program in RVW. When a program is suspended in RVW, the physics are turned off. This will cause you robot to be stationary although the motor is on. We will be sure to look into a way to improve this in the future.

An alternative method is to use wait commands instead of break points in your program. This will allow you to have time to see motor values, sensor values, ect. while your program "waits" instead of suspends. Using your example from above, you can set it up like this:
Code:
task main()
{
   motor[motorB] = 50;
   wait1Msec(5000); //Wait 5 seconds before continuing on to the next step of the program
   motor[motorC] = 50;
   wait1Msec(5000); //Wait 5 seconds before continuing on to the next step of the program
}


Please let me know if you have any more questions.

Thanks, Lee


Tue Oct 28, 2014 12:55 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.