Go to Post I sure hope kickoff comes soon. Otherwise, you're all getting sent for therapy ;) - Rich Kressly [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-05-2006, 11:52
Steve0100's Avatar
Steve0100 Steve0100 is offline
Steve0100
no team
 
Join Date: Apr 2006
Location: PDX
Posts: 11
Steve0100 is on a distinguished road
EasyC-Vex Rx/motor frustrations- please help!

Howdy all-

I'm new to programming Vex, and I'm encountering some frustrating limitations with the EasyC programming kit(V1). Foremost is the distinction between Autonomous and competition modes. The only blending of the two modes can hapen in two loops, but I've been trying to write a program to control my 4- wheel holonomic drive and the instant I drop a motor module command that uses a variable from GetRx into a program, the controller no longer reponds to any Rx commands, appearently because I've mixed blocks from the Rx and comp modes.

Is there a way around this in EasyC? Within the same loop, I need to put Rx channel inputs into variables, modify them mathmatically, and then output to the motors using the motor module, not the motor module Rx, using the new variable information.

Is there no provision for this kind of blending of Rx input and Autonomous motor control within EasyC? Or is it only one mode ot the other, within different loops- as it appears.
This is driving me crazy- thanks in advance for any help.

Steve
  #2   Spotlight this post!  
Unread 06-05-2006, 11:56
Steve0100's Avatar
Steve0100 Steve0100 is offline
Steve0100
no team
 
Join Date: Apr 2006
Location: PDX
Posts: 11
Steve0100 is on a distinguished road
Re: EasyC-Vex Rx/motor frustrations- please help!

To clarify- The kind of program I am trying to make work is similar to the one described in this thread-

http://www.chiefdelphi.com/forums/sh...=vex+holonomic

Which is EasyC V2 Code- is this program possible in the un-upgraded version?

Thanks again
  #3   Spotlight this post!  
Unread 06-05-2006, 12:16
Francis-134's Avatar
Francis-134 Francis-134 is offline
Lifer
FRC #0190 (Gompei and the Herd)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Worcester, MA
Posts: 602
Francis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond repute
Re: EasyC-Vex Rx/motor frustrations- please help!

I am almost sure that you can do what you want with easy C. However, I am having some trouble following what you want to do exactly and figuring out your problem. If you wish to drive your holomic robot, do not use both the RC driving blocks (i.e. two-motor or four-motor drive) and the motor module blocks. Simply use the motor blocks with the output being a variable. For example;

Retrieve a value from the joysticks using the Rx input block and set it to a variable.

Modify the variable however you like

Set the variable to a motor module with the output being that variable. Your robot will now drive based on how you modify the values being retrieved from the joysticks. For a program like this, there is no difference between easyC v1 or v2.

Hope this helps. If you still can't get it to work don't be afraid to come around these parts again .
__________________

Email | Twitter | Facebook | YouTube | Twitch
iTunes Podcast | Snapchat

A proud alumnus of teams 134 and 40 || Mentor of Team 190 || Director of Fun for BattleCry@WPI

Last edited by Francis-134 : 06-05-2006 at 12:22.
  #4   Spotlight this post!  
Unread 06-05-2006, 12:38
Steve0100's Avatar
Steve0100 Steve0100 is offline
Steve0100
no team
 
Join Date: Apr 2006
Location: PDX
Posts: 11
Steve0100 is on a distinguished road
Re: EasyC-Vex Rx/motor frustrations- please help!

Quote:
Originally Posted by Francis-134
I am almost sure that you can do what you want with easy C. However, I am having some trouble following what you want to do exactly and figuring out your problem. If you wish to drive your holomic robot, do not use both the RC driving blocks (i.e. two-motor or four-motor drive) and the motor module blocks. Simply use the motor blocks with the output being a variable. For example;

Retrieve a value from the joysticks from the
Thanks for the rapid reply!

Yes, this is exactly what I have in my program. I Put joystick values into variables for each axis, modify the variables, and then use the motor module blocks with the output being these modified variables fetched from GetRx Blocks. I use no RC driving blocks. The problem is, that the GetRx commands do not work when I have the motor block (non-Rc) with the variable outputs in the same loop. The Green activity light for Rx does not even come on on the controller. By using the print to screen block, I can see that the varables Fetched from GetRx are not changing at all as I move the joysticks. But, if I eliminate the motor module blocks, and re-download the program, all of a sudden the Rx activity light works, and the GetRx variables printed out to the screen change as they should. If i drop in just a single motor module block using one of these variable, then all Rx functionality goes away again.

It's like the motor module is a poison block when used in the same loop as GetRx that kills RC inputs. I suspect that this has to do with keeping the notions of autonomous and competition modes strictly enforced, so I hope that there is a way to circumvent this problem. I've tried using the code exaclty as above from the "It's a Vex Holonomic Drive!" thread, with the same problem.

I'm using Master Code 5, and the header on the EasyC i/o block is #include "UserAPI.h" while the holonomic code above has #include "main.h"
I wonder if that has anything to do with it?
  #5   Spotlight this post!  
Unread 07-07-2006, 00:35
jrod2008 jrod2008 is offline
Registered User
FRC #1227
 
Join Date: Jul 2006
Location: Grand Rapids, MI
Posts: 3
jrod2008 is an unknown quantity at this point
Re: EasyC-Vex Rx/motor frustrations- please help!

I had the same problem, so I am trying to "trick" the software. I tried making the motor functions part of a user block and modifing them there, like

SetMotor(1,(leftjoystickvalue*(465/500))


or something like that, I'm too lazy to get the real code , but it didn't work . Maybe I'll try the goto C command. I heard someone say that the VEX kit checks to see if one modifies the variables in the same loop as an RX block. The goto command could probably trick it. Does it work in EasyC?

Update: the goto command works, but it didn't trick the vex kit.

Last edited by jrod2008 : 07-07-2006 at 01:54.
  #6   Spotlight this post!  
Unread 07-07-2006, 10:27
UnderDark's Avatar
UnderDark UnderDark is offline
Alumni
AKA: Matthew Korzeniowski
FRC #0862 (Lightning Robotics)
Team Role: Alumni
 
Join Date: Mar 2006
Rookie Year: 2004
Location: Canton, Michigan
Posts: 14
UnderDark will become famous soon enough
Re: EasyC-Vex Rx/motor frustrations- please help!

Use the SetPWM() function: it doesn't interupt the user control when I use it, whilke SetMotor/Server() did.
__________________
"My gaming is FIRST!"
-Joe Jagadics

"I am like an all powerful warloard"
-Brian Graham
  #7   Spotlight this post!  
Unread 07-07-2006, 20:34
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: EasyC-Vex Rx/motor frustrations- please help!

Quote:
Originally Posted by Steve0100
the GetRx commands do not work when I have the motor block (non-Rc) with the variable outputs in the same loop.
I encountered the same problem, and the Intelitek help forum folks were not helpful at all. I did not figure out how to get around it.

If anyone HAS figured out how to have the Vex bot do some autonomous stuff, but able to be overridden by the transmitter (using the GetRX command, for instance) PLEASE share what you know.

If anyone needs sample code, just PM me.

Don
__________________

I am N2IRZ - What's your callsign?
  #8   Spotlight this post!  
Unread 07-07-2006, 20:45
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: EasyC-Vex Rx/motor frustrations- please help!

I haven't programmed the VEX yet, but isn't it about the same as programming for the FRC controller?

We used the setPWM command to control the FRC. We have sample code here: "FRC version".

http://www.frcsoft.com/forums/index.php?dlcategory=6

Maybe that will help some, then maybe I need to check out the VEX programming someday I have some time....
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #9   Spotlight this post!  
Unread 07-07-2006, 20:56
DonRotolo's Avatar
DonRotolo DonRotolo is offline
Back to humble
FRC #0832
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Atlanta GA
Posts: 7,011
DonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond reputeDonRotolo has a reputation beyond repute
Re: EasyC-Vex Rx/motor frustrations- please help!

Very similar, but not exactly the same.

I am sure that what I'm trying to do - let the robot do it's own thing, but allow inputs from the OI override anything - can be done with FRC. The vex controller is something else - I have a feeling the issue is related to EasyC and not the hardware.

I will try the SetPWM() function as UnderDark suggests before I whine any more. Though I might try the EasyC 2.0 version, see what that does.

Don
__________________

I am N2IRZ - What's your callsign?
  #10   Spotlight this post!  
Unread 07-07-2006, 21:22
Francis-134's Avatar
Francis-134 Francis-134 is offline
Lifer
FRC #0190 (Gompei and the Herd)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Worcester, MA
Posts: 602
Francis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond reputeFrancis-134 has a reputation beyond repute
Re: EasyC-Vex Rx/motor frustrations- please help!

I think I understand what you are attempting to do, however, I'm not sure. Perhaps if you posted your easyC code (not the blocks, just the text in the window on the right), it would be easier to diagnose your problem. I am 99.9% sure that the problem is not easyC, as there are no real limitations in the software itself.
__________________

Email | Twitter | Facebook | YouTube | Twitch
iTunes Podcast | Snapchat

A proud alumnus of teams 134 and 40 || Mentor of Team 190 || Director of Fun for BattleCry@WPI
  #11   Spotlight this post!  
Unread 08-07-2006, 02:18
Matt H. Matt H. is offline
Long Distance Mentor
FRC #1726 (N.E.R.D.S.)
Team Role: Alumni
 
Join Date: May 2006
Rookie Year: 2007
Location: Sierra Vista, AZ
Posts: 238
Matt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond reputeMatt H. has a reputation beyond repute
Re: EasyC-Vex Rx/motor frustrations- please help!

If vex EasyC is anything like FRC EasyC then I believe you can choose not to build your project in a competition format. See if there is a option for that.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Vex Easyc vs Mplab Joohoo Programming 17 27-01-2006 08:22
EasyC 2.0 for VEX Robotics Kit jeffmorris Programming 7 26-01-2006 10:21
EasyC for FVC & Vex petek Programming 2 13-01-2006 15:55
White Paper Discuss: VEX / intelitek easyC programming document dez250 Extra Discussion 3 15-09-2005 15:20


All times are GMT -5. The time now is 23:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi