View unanswered posts | View active topics It is currently Thu Jul 24, 2014 12:36 am






Reply to topic  [ 11 posts ] 
Another Bug...RobotC limits to 14 files...sortof 
Author Message
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Another Bug...RobotC limits to 14 files...sortof
Since the bug tracker website is broken and there doesn't appear to be a forum directly related to RobotC bugs and features, I'll post this one here.

So it actually took me a little while to notice this as a bug with RobotC mostly because I don't USE RobotC to edit most of my code (I use Eclipse and have RobotC open for compiling and debugging)

It seems RobotC limits users to only having 14 files in a program. But its not really a hard limit, its more of a "the editor stops working right" limit.

So the compiler doesn't complain (which it shouldn't and this is good).
But if there is an error on file #15+ the editor opens a blank screen ?!?!?!? I'm totally at lost for words on how silly this is. No warning, no error of any kind, just a big white empty screen.

Also the menu only displays the first 14 files so you can't actually open the other files manually. This I understand. I just disagree fundamentally with the user interface choices that demanded this limit to begin with.

At first I thought it was a "sharing" issue between eclipse and RobotC, but no definitely its all RobotC.

I don't expect any quick fix from RobotC, but I also don't accept that there is any reasonable limit on how many source files a program could/should have.

For now I just wrote a python script that collates most of the code I'm not actively working on into one big file....but that's a hack and this needs a real fix...eventually.

And while I'm thinking of it...the compiler really needs to list the file name and line number of the errors. I'm not quite sure how we're expected to know which file #12 was...I know, clicking on the error takes you right to it...except when it doesn't.


Fri Feb 13, 2009 10:36 pm
Profile
Rookie

Joined: Tue Mar 18, 2008 7:11 pm
Posts: 22
Location: San Antonio, TX
Post Re: Another Bug...RobotC limits to 14 files...sortof
I can't help with the bug but try this for MANTIS:
http://www.robotc.net/mantis/login_page.php

Sean


Mon Feb 16, 2009 2:06 pm
Profile
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:42 am
Posts: 601
Post Re: Another Bug...RobotC limits to 14 files...sortof
I can admit that this is a bug... but seeing as ROBOTC doesn't require the use of #include statements to include everyday libraries (like math or using sensors), what in the world do you need 14 include files for?

This is a fairly low priority issue as 99.9999% of ROBOTC users have not run into this issue over 3 years.

_________________
Timothy Friez
ROBOTC Developer - SW Engineer
tfriez@robotc.net


Mon Feb 16, 2009 4:57 pm
Profile
Expert
User avatar

Joined: Tue Oct 14, 2008 7:16 pm
Posts: 171
Location: Investigating an unidentified ship sighted in Sector 31428
Post Re: Another Bug...RobotC limits to 14 files...sortof
Mind you 99.9999% of RobotC users probably don't have the need, foresight, or desire to separate code into seperate files like us object oriented types do. :eek: :roll:

And while we're on the matter of RobotC limits, let it be known that you can not declare more than 10 tasks, no matter how many files you spread them across. Would you, could you, please document all of these little minutia in the help files for those who care; those who don't can just ignore it.

_________________
Captain, Head programmer, School of the Arts, Silverbots Robtics Team #2890
Code:
using namespace System;
using namespace Genius;
using namespace Personality;
public ref class Nerd : Geek, IAnserable
{
    Geek::Type brainMode = Geek::Type::Programmer;
}


Tue Feb 17, 2009 12:41 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Another Bug...RobotC limits to 14 files...sortof
You are not the first to bump your head on some of these hidden limits and you are not the first to ask for these "features" to be documented somewhere.

Proper documentation of all the functions, parameters, return values and the FW limitations has yet to be written/collated. Some of it is in the help file and some of it can be found through careful searching through the forums or the general Interwebs but there is no central place.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Tue Feb 17, 2009 10:58 am
Profile WWW
Expert
User avatar

Joined: Tue Oct 14, 2008 7:16 pm
Posts: 171
Location: Investigating an unidentified ship sighted in Sector 31428
Post Re: Another Bug...RobotC limits to 14 files...sortof
Yes, that's the point, why hasn't it been yet? :?

_________________
Captain, Head programmer, School of the Arts, Silverbots Robtics Team #2890
Code:
using namespace System;
using namespace Genius;
using namespace Personality;
public ref class Nerd : Geek, IAnserable
{
    Geek::Type brainMode = Geek::Type::Programmer;
}


Tue Feb 17, 2009 1:07 pm
Profile
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: Another Bug...RobotC limits to 14 files...sortof
Quote:
what in the world do you need 14 include files for

I'm not trying to be a pest or confrontational...but are you serious?

I've got 20+ files and I really haven't done anything remotely complicated with autonomous (no neural networks, bayesian learning or SLAM, ...yet)

Just to justify that I'm not as totally crazy as you claim I am... I've listed the ones I'm currently using and explain what each one is for.
Quote:
1. ctypes.h - (int16, int32, uint16, uint32, etc)
okay this first one isn't really needed :) but I don't trust compiler writers to not change type sizes on me.
also lets code be more portable to/from other platforms
2. globals.h - defines all of the global variables that are used throughout the entire program. Since there's no pointers or dynamic allocation. The only way to make functions reusable is to have typedef structures and static instances. Also I'll point out that array implementation inside of structures is somewhere between flaky and broken.

3. drive.c - generic implementation of a robot drive. Provides multiple drive modes: Heading/Distance, Heading/Speed, Speed/Turn Rate, Manual, etc. Uses a 2 wheeled kinematic equations so that you can specify driving by in/sec and degree/sec instead of % motor power.

also implements odometry (inverse kinematics) to keep track of the position and orientation of the robot
using the encoders.

4. actuator.c - implements control over robot actuators. implements code that track robot joint orientation (actual position)

5. sensors.c - implements a task that continuously monitors all the sensors connected to the robot and updates the global
variables as needed.

6. advjoystickdriver.c - implements all the important things that the default driver leaves out

7. fuzzy.c - generic implementation of a fuzzy logic controller

8. behavior.c - generic implementation of a subsumption architecture behavior module: defines the target/desired state of drive and actuators.

9. robot.c - provides robot specific implementation of the main control loop:
Sensors determine actual state of robot -> behavior determines desired state of robot -> drive/actuator control makes the actual state == desired state.

10. manual.c - connects the joystick input to behaviour module for robot control during teleop

11. auto.c - connects the autonomous code to behavior module for robot control during autonomous

12. param.c - loads calibration data and autonomous parameters from a file

13. menu.c - provides a user interface for selecting autonomous parameters and selecting debug screens

14. kalman.c - provides a generic implementation of a kalman filter to correct the cheap LEGO sensors

15. proto.c - provides a driver to connect to the HTPB since ROBOTC doesn't include this built in.

16. simple_drive.c - provides the callback functions for the behavior module

17. simple_drive_sa.c - Python script generated, specific implementation of subsumption architecture for behavior module.

18. arm_ctrl.c - Python script generated, specific implementation of fuzzy logic controller for arm control

19. drv_ang_ctrl.c - Python script generated, specific implementation of fuzzy logic controller for heading/angle control

20. drv_pos_ctrl.c - Python script generated, specific implementation of fuzzy logic controller for distance/speed control

21. fuzzy_ctrl.c - provides a task the runs/updates all the fuzzy controllers at a specific rate


So thats how I use more than 14 files in a single program. Sure I can combine this all into one file, but that's not the point.

RobotC is for writing programs for real robots isn't it? Its being promoted as more than just for toys. FTC is being promoted as being more of a "real" robot challenge.

I would bet any major academic robot project uses this many files (or probably a whole lot more)

How many files do you think the mars rover uses? or the predator? I know where not in that league, but you seriously never "thought" a programmer might reasonably want more than 14 files.


Wed Feb 18, 2009 6:21 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Another Bug...RobotC limits to 14 files...sortof
chadgeorge wrote:
Quote:
what in the world do you need 14 include files for

I'm not trying to be a pest or confrontational...but are you serious?

I've got 20+ files and I really haven't done anything remotely complicated with autonomous (no neural networks, bayesian learning or SLAM, ...yet)

Just to justify that I'm not as totally crazy as you claim I am... I've listed the ones I'm currently using and explain what each one is for.

<snip snip>

So thats how I use more than 14 files in a single program. Sure I can combine this all into one file, but that's not the point.

RobotC is for writing programs for real robots isn't it? Its being promoted as more than just for toys. FTC is being promoted as being more of a "real" robot challenge.

I would bet any major academic robot project uses this many files (or probably a whole lot more)

How many files do you think the mars rover uses? or the predator? I know where not in that league, but you seriously never "thought" a programmer might reasonably want more than 14 files.

There are some other "grown-up" features that RobotC is lacking such as the ability to include a file multiple times without the compiler barfing about it. Right now you have to put something like this:
Code:
#ifndef __I2C_H__
#include "i2c.h"
#endif //__I2C_H__

in your program so that it'll work. Having the standard
Code:
#ifndef __I2C_H__
#define __I2C_H__
<your code>
#endif // __I2C_H__

apparently is not good enough. I love using abstraction when writing drivers. I have a generic I2C library that handles errors and other things, a device specific driver that makes use of this and then, of course, the main program. If I have two devices, like the MAX127 and the MCP23008, both of which use this generic I2C library, I have to use the above mentioned trick to get it to compile. It's an ugly hack and I don't like hacks like that.

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Wed Feb 18, 2009 7:11 pm
Profile WWW
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: Another Bug...RobotC limits to 14 files...sortof
yes I found out the hard way many months ago. another lack of documentation thing i guess.

here's how I do it personally:

Code:
#if !defined(SOME_FILE_C)
#include "somefile.c
#endif


and of course in somefile.c
Code:
#define SOME_FILE_C


that is until you hit the mystical-magical number 14 and then you have to do something like
Code:
python collate.py robot.c > robot_top.c

...

#include "robot_top.c"

and that script goes thru and does all the includes in order to create one big massive file...and ROBOTC is happy once again.


Wed Feb 18, 2009 7:38 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3162
Location: Rotterdam, The Netherlands
Post Re: Another Bug...RobotC limits to 14 files...sortof
A separate compiler/assembler/linker toolkit would allow people to use their own favourite editor. I use WinAVR and Programmer's Notepad 2 when I am programming my AVR uCs. I am assuming you edit most of your files in a different editor and then load the whole collated thing in RobotC after? If so, that must make debugging a lot of fun!

Regards,
Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Feb 19, 2009 3:36 am
Profile WWW
Novice

Joined: Fri Oct 24, 2008 8:58 am
Posts: 87
Post Re: Another Bug...RobotC limits to 14 files...sortof
Yes. I use eclipse and just keep RobotC open with the top level file...since it annoyingly goes back to that one every time you compile anyway :?

I think there are good things about the RobotC IDE for really small projects and beginner programmers.

I like wireless programming (and the incremental loading is very fast which is good). I like alot of the debugging features. And the integrated joystick control station is brilliant (compared to the nightmare that the poor Labview folks have to deal with)

But I agree. I would like to be able to compile and link in my own IDE. I doubt it would be that much work to provide a command line interface to allow other IDEs to use their compiler.


Thu Feb 19, 2009 10:37 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 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.