Stupid RoboGuide "Files" question

  • I'm writing a lot of TP and KAREL in RG. I normally start by right-clicking on "Files" in the navigation tree, "New File", and the file type I want to create. When I do this, the new file appears to be created in the root directory of the cell. Which makes sense, b/c these files are being created at the cell level, not per individual robot. When I use the "build" function, the compiled (TP or PC) version of the ASCII file gets added to the Files tree, and exported into the robot's Program section (I've only been doing this with single-robot cells so far, so I don't know what happens in a multi-robot cell).


    Now, the files being stored in the cell root directory is handy, b/c I can open the ASCII files in parallel in NotePad++, which is nicer than the RG editor for some operations. I'd also been thinking about using Git or some other version control on my source files, after very nearly losing weeks of work when RG crashed and completely corrupted my cell this past weekend.


    But... when I use the "Add" function of "Files", the pattern seems to break down. What I did:

    1. Set the Default Directory in Files to the root directory of the cell

    2. Copied my LS and KL files into that directory (the files did not auto-add themselves to the tree, even after rebooting RG)

    3. Performed a manual "Add Files" on all the LS and KL files. This worked, but...


    Even after that, when I make changes in the RG editor and Save or Build, the changes are not reflected in the actual ASCII files in the cell root directory. Even if I use "Save As," the save path is already defaulted to this directory. Forcing the save generates a "do you want to replace the file" prompt, but if I hit "yes", the actual ASCII file does not update.


    So far, the only way I've been able to force the root-directory ASCII files to update is to do an ASCII backup, then copy the LS files from the backup to the root directory. This doesn't work for the KL files, obviously.


    So... if I want to find a reliable location on my hard drive where all these source files are located, and get updated when I use Save or Build in the RG editor, what do I need to do?

  • My opinion, don't use roboguide to manage the files. Create a project folder outside of roboguide to manage your source files. You can either use the command line utilities or Roboguide to compile them. I prefer command line. Then I just bring the updated binaries into roboguide as needed for testing.


    If I'm confident in what I'm doing then I dont even bother with roboguide, I just compile using the command line maketp function and then FTP the files to the real robot.


    You can even FTP files to a robot in roboguide.


    Roboguide is good for testing, but not good for writing or managing programs. These days I hardly open roboguide.

  • Command line tools? ???


    I've been using RG's editor b/c I, frankly, am still a rank amateur at TP and KAREL, and needed to hit "build" every few lines to ensure I hadn't created some obscure error that would send me chasing down a rabbit hole for a couple hours (it happened anyway, but less often with the regular compiler feedback).

  • ... 1. Set the Default Directory in Files to the root directory of the cell

    ...

    What do you mean by 'root directory of the cell' exactly, what other files are there.


    I can tell you that I haven't had problems like you. May be your RG installation is screwed up.

    When I change the ASCII files in the directory, they are always up to date, in that directory, not on the simulated robot, this must be done manually. Normally I change the default directory to a directory in my project folder who has nothing to do with the simulation (separate data partition), and never ever had problems with corrupted files, even when RG crashes (what happens sometimes).

    The built binaries can be loaded to the simulated robot by 'right click' and 'load'.


    2. Copied my LS and KL files into that directory (the files did not auto-add themselves to the tree, even after rebooting RG)

    This seems to be normal, it's the same on my RG.


    You must be aware that there are two different locations in RG (if you have a real robot then there are three).

    1. files on the simulated robot, the programs section.

    2. files on local hard disk, the files section.

    (3. the real robot)


    You can add, create, edit and build files on local hard disk.

    You can load the files from local disk to the simulated robot by 'right click' and 'load'.

    You can save files from simulated robot to lokal disk, in ASCII or binary format.

    You can export files from local disk to the simulated robot (result is the same as loading them, but you have to use RobotNeighbourhood for that).

    And much more things, but this are the things I use frequently.


    Most of this can be done by a right click onto the filename in the files section or Program section.

    I can use Notepad++ for the files in the section, and build them in RG (after I have added them once).

    If I use the build button in the RG editor the actual file is saved and then the build process starts.

    Command line tools? ???


    I've been using RG's editor b/c I, frankly, am still a rank amateur at TP and KAREL, and needed to hit "build" every few lines to ensure I hadn't created some obscure error that would send me chasing down a rabbit hole for a couple hours (it happened anyway, but less often with the regular compiler feedback).

    I'm working the same way: don't use command line tools, absolutely not neccessary, don't know how to use them, think using RG is much more effective.

    I also hit 'build' frequently to check my code, then I load it to the simulated robot to test it, and then I export it to the real robot.

    The only silly thing is: If the program that I want to build is selected in the simulated robot the build will fail after waiting for a quite long time. After selecting a different program on the simulated robot, the next build succeeds, with more or less faults, because of my typos :winking_face:.

  • What do you mean by 'root directory of the cell' exactly, what other files are there.

    In my case, /Documents/My WorkCells/CellName/


    This seems to be the "default" location, if I just create the cell, right-click on Files, and select "new file".

    You can add, create, edit and build files on local hard disk.

    That's what I'd like to do, but am having trouble with.

    You can load the files from local disk to the simulated robot by 'right click' and 'load'.

    I actually haven't needed to do that -- it happens automagically when I hit Build. The compiled program just shows up (or gets updated) in the robot's Programs section.

    You can save files from simulated robot to lokal disk, in ASCII or binary format.

    So far, I haven't found any way to save the ASCII version of a PC file. If I lose my "master copy" of the KL file, I'm hosed.

    I can use Notepad++ for the files in the section, and build them in RG (after I have added them once).

    This definitely does not work for me. Making changes in NotePad++ doesn't seem to carry into RG, even if I reboot RG entirely. But then, I can't figure out where RG is keeping all these files. Even when I deliberately change the Files Default Directory, the files in that directory do not update when I use Save or Build in RG. RG is keeping the "master copies" somewhere, but I can't figure out where. Or even force RG to use the directory of my choosing, so far.


    It does appear that using the File Add function creates a link to a file's location, rather than copying the file into whatever RG is using as a "working directory" -- when I used Add on some files that were on a USB drive, they all vanished from RG when I unplugged the USB.

    The only silly thing is: If the program that I want to build is selected in the simulated robot the build will fail after waiting for a quite long time.

    That one I ran into a lot, especially since I'm working on (among other things) background programs (not BG-Logic) that start on boot and run forever. What I discovered is that, if the program I'm trying to Build is still running, or even just selected, on the virtual robot, that blocks the Build process. Or, rather, probably blocks the automatic "export" to the virtual robot. Generally, terminating my background program or doing an Abort All on the virtual pendant fixes this.

  • This definitely does not work for me. Making changes in NotePad++ doesn't seem to carry into RG, even if I reboot RG entirely. But then, I can't figure out where RG is keeping all these files. Even when I deliberately change the Files Default Directory, the files in that directory do not update when I use Save or Build in RG. RG is keeping the "master copies" somewhere, but I can't figure out where. Or even force RG to use the directory of my choosing, so far.

    This is strange. No problems with that. I can add files that are in a subfolder of the default file folder (or go one folder up and select there a file from a different subfolder) and even they are updated correct.


    Saving the ASCII version of a compiled Karel file is not possible that's correct. It's up to you to keep the Karel sources in a safe place. That's really very diffcult in case RG keeps them in a secret place. There must be something wrong with your installation, I never had those problems.

    Did you ever try a complete different folder for the sources? I always use a different folder.

    What is your version of RG? I have Version 9 (Rev I)

  • What is your version of RG? I have Version 9 (Rev I)

    9L here as well. When I have time, I'll have to try setting up a new cell from scratch and create my "source control" directory before I start creating any files. But I'm too under the gun right now to spend the time.

Advertising from our partners