RoboEmu 1.09 (supports PBASIC 2.5)

Well, I’m only 6 hours (or 30, depending on which promise) late, but here it is: RoboEmu 1.09. It includes support for everything in the spiffy new default code, as well as a number of bug fixes and new features.

Notably, it now supports PBASIC 2.5, has a user_mode display, supports autonomous mode. There’s also some experimental support for user-changeable run speeds, but that may go away in the next version depending on how it works

As always, it’s available at http://www.robbayer.com/software.html or in the white papers.

I know I ask this every time, but it’s especially necesary this time: let me know how it works! I’ve checked everything I could think of, but with a whole new language, I’m sure I missed something. Likewise, I would like to know if anybody finds any other PBASIC 2.5 commands aside from SELECT, DO, LOOP, and the new forms of IF.

–Rob

I’d just like to thank you for your continuing service to the FIRST community, Rob!!!

Thanks. Your programs are REALLY helpful!

You’re all very welcome. As long as people keep using them, I’ll keep maintaining them.

I do have one question for some PBASIC gurus out there: What makes a line a complete command? I realized that I forgot to add the ability for commands to span multiple line to version 1.09, mainly because I spent a lot of time trying to figure out how to determine whether a line was “complete” or whether it spilled over into the next one. Here’s what I’ve got so far:

Equal number of “(” and “)”. Same with and ]. Even number of quote marks. No commas hanging off the end.

Anything else that defines a complete statement?

I think a backslash at the end of a line will contain the next line in the command…

like

Serin COMA\COMB, INBAUD, [oi_swA,oi_swB,rc_swA,rc_swB, \
p2_x,p1_x,p4_x,p3_x,PB_mode, \
packet_num,p2_y,p1_y,p4_y,p3_y, \
p2_wheel,p1_wheel,p4_wheel,p3_wheel]

The trailing backslash will continue the line in this preprocessor, but it is not a standard language feature. It would be nice to have support for it in RoboEmu though… I would also like to give Rob my sincere thanks for creating and maintaining such a valuable aid!

*Originally posted by Caleb Fulton *
**I think a backslash at the end of a line will contain the next line in the command…
**

If only life were so simple…

If you look at the new default code, you will see:


Serout USERCPU, OUTBAUD, [255,255,p1_y,relayA,p2_y,relayB,p3_y,p4_y,p1_x,p2_x,p3_x,p4_x,
p1_wheel,p2_wheel,p3_wheel,p4_wheel]

I think I’ve gotten it straightened out now, but I want to test it a little more before I release 1.09b. The change just isn’t significant enough to merit a whole new version number…

Once I get some free time (haha, right) I’m planning on doing major testing. I do QA testing at a small software company, so I think I make a pretty qualified tester. Of course, my reasons are selfish, I just want the best tool possible to use when it actually matters. Just waiting for the free time to smack me in the face.

could you add the OUTH variable. It’s just a the Output pins 8-15. It’ll make it easier to program the output byte for usermode

No problem. It’s on the list of things to do for 1.10.

OK, I’m having issues with the new RoboEmu 2.5 Select support - I know you said its beta, but maybe some specific feedback will help.

I get the error “variable >132 does not exist”
I am doing a select command similar to what follow:

Select (arm_joint1) [hint hint about 159]
Case >ajoint1+slack
'some code
Case…

Case Else

EndSelect

Assumably, ajoint+slack is evaluated to be 132; and your program expects a variable there.

According to the examples that Parallax gave us for 2.5, an operator should be able to come directly after the “Case” statement. I’ll send you the code.

Hmmm… I definately never saw any documentation from Parallax, so I didn’t even know you could put an operator in there like that.

You’re getting the current error because it only expects expressions, meaning it evaluates them recursively. Thus it added ajoint1 and slack and then replaced the appropriate part of the expression with the value it got back. It then tried to re-evaluate the new expression, thought it was a variable because it is only one word, and tried to lookup “>132.”

Thanks for the heads up and I’ll try to incorporate that into the next version as it should be VERY easy to fix. I also kinda forgot about the OUTH variable, so I’ll do that too.

–Rob

Do you mean your program would expect something more like:

Select arm_joint1
CASE arm_joint1>ajoin+slack
etc.
etc.
EndSelect

Or that it only supports:

Select arm_joint1
CASE 0 to ajoin+slack
etc.
etc.
EndSelect

It would be much appreciated to have that update…when can we expect it?

No, I mean that my program doesn’t expect any operator there and tries to evaluate the expression “couter=CASE”, which in this instance turned into “arm_joint1=>132”. Not pretty. I’m actually kinda surprised it didn’t blow up. Oh well.

I’m REALLY busy until 9:00pm Thursday night (my Eagle Scoutmaster Conference), but I’ll try to work on it after that. It shouldn’t take more than an hour to add the support. As soon as I finish it, I’ll let you know.

Randomly playing around with RoboEmu and the default code. Clicked Switch 5, and up popped “Error: Variable P3_YMAX127 does not exist. Can’t get value.”

Looks like single line IF…THEN doesn’t handle MIN and MAX operators.

Yeah, somebody else just told me about that last night. I’m now hitting my head against my desk repeatedly for adding a call to removeSpaces withing the makeCmdIf function. Stupid, stupid, stupid, stupid, stupid…

Look for yet another new version by tomorrow night.

Does RoboEmu support the modulus operator (//)? I have a statement:

if (CCDataIn <> ((PrevDataIn + 2) // 256)) then

and it give the error “Error: Variable /256 does not exist. Can’t get value. While processing If @((CCDATAIN;((PREVDATAIN+2)//256)))”

Thanks for the tool, it’s been a big help while we’re sitting around waiting for a robot to play with.

Mike

Ooops. Kinda forgot that one. Look for it in 1.10 as it definately should be there.

Does the RoboEMU support delta_t?

No. It wouldn’t really work, either, due to the speed differences between computers. If I figure out a way of making it work, I might add it. Anyway, 1.10 is done now, so grab that.