View unanswered posts | View active topics It is currently Sat Oct 25, 2014 2:30 pm






Reply to topic  [ 5 posts ] 
loading files into first tech challenge virtual world 
Author Message
Rookie

Joined: Thu Sep 13, 2012 12:34 am
Posts: 2
Post loading files into first tech challenge virtual world
Hello, I recently found robot virtual world and want to use it to test autonomous programs. How do I load a customized file into the "ring it up" virtual world? Any links to videos or advice would be great!

Thanks so much for your help!


Thu Sep 13, 2012 12:41 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 596
Post Re: loading files into first tech challenge virtual world
All you should have to do is load the ROBOTC program as normal, then make sure the "Compiler Target" under the Robot menu is set to Virtual Worlds and that the "Select Virtual World to Use" option under the Menu menu is set to 'FTC Ring it UP!'.

From that point on, compiling and downloading the program will open up the Ring it Up! Virtual World instead of sending the code to the robot (until you change the compiler target again).

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Thu Sep 13, 2012 9:31 am
Profile
Rookie

Joined: Thu Sep 13, 2012 12:34 am
Posts: 2
Post Re: loading files into first tech challenge virtual world
do the robots built in have some anti-encoder setup? When I run my program it doesn't pay attention to encoder counts.


Thu Sep 13, 2012 7:02 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 596
Post Re: loading files into first tech challenge virtual world
I'm looking into this now, I believe it's a known issue with 3.5 but should be fixed soon. Let me double check to confirm this, though, and I'll get back to you with my results. Thank you for the heads up!

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Mon Sep 17, 2012 10:42 am
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 596
Post Re: loading files into first tech challenge virtual world
Ok, so I dug a little bit more into this and there is encoder support for the FTC Ring It Up! table on motors D and E (drive motors). There are no wrist/gripper encoders available at the time of this release.

The following code to move forward for 500 encoder counts will work because the encoders on motors D and E are active:

Code:
task main()
{
    int moveDistance = 500; //Integer used to set how many encoder counts we would like to move
   
   while (nMotorEncoder[motorD] < moveDistance) //While the encoder value of the front right motor (D) is less than 500 (moveDistance), move forward
      {
        motor[motorD] = 50; //D and F are front and rear right drive motors (respectively)
        motor[motorF] = 50;
       
        motor[motorE] = 50; //E and G are front and rear left drive motors (respectively)
        motor[motorG] = 50;
     }
}



However, the code to rotate the wrist back and forth won't:
Code:
task main()
{
   int moveArm = 250; //Integer used to set how many encoder counts we would like to move the wrist
      
        while (nMotorEncoder[motorB] < moveArm) //While the encoder value of the wrist (motor B) is less than 250 (moveArm value), rotate it upwards
           {
             motor[motorB]=50;
           }
          
        while (nMotorEncoder[motorB] > 0) //While the encoder value of the wrist is greater than 0, rotate it downwards
            {
                     motor[motorB]=-50; 
            }
}


What will happen is the wrist 'encoder' (that doesn't exist in RVW, yet) returns a value of 0 no matter where the wrist is at. Since the while loop is looking for a greater than 250, and 0 will never be greater than 250, the wrist will rotate upwards until it physically hits a restraint. It's hard to see, but the program actually keeps running inside of the first 'while' loop because it's going to keep trying to hit the 250 encoder counts mark, which it never will.

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Tue Sep 18, 2012 9:57 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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:  
cron



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