New Path Generation Front End

This past season Error Code Xero took our first shot at path following. We used Path Weaver to generate the paths and a simple follower that was seen in other robot code that was a modified PID with feed forward terms for both velocity and acceleration. We also use a NAVX for correcting the heading. While teaching the students about path following via many white board sessions, I wished I had a tool that would do a better job of demonstrating this to the students. To that end, I have spent a great deal of time this off season creating my version of a Path Weaver style tool. In addition to making something more usable, the idea was to make something to help in teaching path following to each new generation of students as they come through.

This is all alpha code, don’t bet your season on anything here. I’m sure there are things I got wrong as I am learning, so feedback welcome.

It comes with the last two years field. It comes with a version of the Jaci Path generator, a generator taken from the Cheesy Poofs code, and a couple of highly experimental backend we are working on here.

This tool has the following features

  • 100% open source
  • Display the X and Y spline equations generated from the waypoints.
  • Plots the trajectory profile below the field window
  • Velocity constraints as a function of distance along the path for those generators that support it
  • Output trajectories as JSON or CSV
  • All generators are separate program. A new executable program and a JSON file describing it is all that is required to add a new generator backend.
  • Uses the Path Weaver format for game fields so the next year’s field should drop right in. There is also a download capability so when the new field is available, it can be dropped automatically detected and downloaded.
  • Undo
  • Uses your units of choice (inches, feet, meters, cm, etc.)
  • Arrow keys (position)/Page Up (rotate)/Page Down(rotate) movement of waypoints
  • Ability to publish generated trajectories to network tables for quick tuning of paths
  • Ability to print paths, helpful for documenting automodes
  • Help documentation (not my strong suit)
  • Demo mode so you can see paths in action.
  • Written in C++ and Qt so there are Windows, Mac OS and Linux versions. I must say I am way more familiar with Window so the Mac OS and Linux versions may need more work.

Thanks
Jack (Butch) Griffin

3 Likes

Sweet, this is excellent. Having some fun playing around with it now. A few suggestions:

image
I assume the Velocities/Accelerations/Jerks are all inches-per-second* ?

The help documentation was super useful, and just the right size. I wasn’t sure what to do when I opened the GUI (and clicking around randomly didn’t have productive results). But, five minutes after reading the help docs, I knew exactly what to do. Maybe have something to either walk people through the process the first time, or point to the documentation on the first launch?

Finally, any way to provide a customized field? And/or will the 2020 game be added within the first week or two of build season? Derp I can’t read.

But other than that, this is excellent. I love the integration of multiple path algortihms, and how smooth and easy it is to adjust and visualize the paths. The generation to CSV/JSON in a specified folder is exactly what I’d be looking for - keep the path source files in the repo, generate csv’s into a folder that gets copied to the robot, parse the files at robot init - all super sweet.

This actually gives me one more idea - is there a command line method to generate paths “headless”? I’m thinking integration into the gradle build process to ensure whatever paths are archived are always freshly generated to CSV files, every build.

I think the team will definitely find this useful this year!!

The velocities, accelerations, and jerks are all in whatever units you put into the units field. There are actually two different units fields that are important. First, what you show is the for the robot. Enter the units you want to use in the second item there and that is the units used for the velocity, acceleration, jerk, etc for the robot. There is a second units field in the Edit/Preference menu that gives the units displayed when interacting with paths on the field. These are the u nits used when editing waypoint fields, path velocities in the path properties windows, etc. The idea is that on the fields you have the units you like to work with. In our case its inches. Other people prefer feet or metric. However, you may get a robot file (via the robot export/import feature) from anywhere and therefore the units for these are independent.

It may seem a little confusing, but think about the robot units independently. The units for the robot internally get converted to field units before being used.

Thanks for the suggestions. I’ll start looking into them this weekend.

Thanks
Jack (Butch) Griffin

Gotcha, the independent units make sense to me. For us, robot is usually in inches, but field locations in feet. It’s all about intuition. I much more readily can imagine “about 12 feet” than “150 inches”.

I have added a new executable program called “PathGenerate”. It is a command line tool that will take a paths file and generate the trajectories giving you ability to create the generated trajectories in the gradle build. It does require that the application be installed on the machine and that the robot be present (created or imported) on that machine in the robot database. I am working on the ability to check the robot file into GIT (so decouple this somewhat) and refer to the robot file via the GUI tool as well as the Path Generator, but there is a bit of work to do there as of yet.

I’ve also added what our team calls flags. Flags are a range within the path, identified by distance along a path, where the flag is true or active. You enter an after distance (where the flag goes active) and a before distance (where the flag goes inactive) for the flag. When the path is generated, a flags file is generated for the path if a flag is present. The flags file contains the flag name and the active and inactive times for the flags. This can be read by the robot code and used to set flags in the robot code. Flags are used in our robot code to cause locations along a path to initiate actions on the robot. For instance, you can set up a flag such that two thirds along a path, the flag goes active and this in turn causes a robot ARM to be raised. These are basically path drive events, but the word event is so overloaded that we used the term flag to refer to these.

Thanks
Jack (Butch) Griffin

2 Likes

Updated with new field image for 2020.

2 Likes

Updated the MAC OS DMG file with build 0.8.19 which includes minor bug fixes and the new field for 2020. Updated the Windows version to same version with minor bug fixes (windows already had the new field).

Note, as always the Mac OS version gets much less use so let me know if there are problems.

Hello! First of all thank you so much for contributing with this program!
I was trying to install it but it gave me this error when trying to open the program:
“The code execution could not continue because it didn’t find find VCRUNTIME140_1.dll. This problem may be solved by reinstalling the program”, any ideas what could’ve gone wrong? I have tried reinstalling it but it didn’t work.

They bundle the VC Runtime installer in the installation, just. run it separately and you’ll get rid of the error. Their installer does not properly see that the dependency of VC Runtime isn’t met, and try to install it.

1 Like

And a quick question, do you know where i can find the documentation to use this program??

Running the VC Runtime installer (vc_redist.x64.exe) will fix this as NewtonCrosby mentioned. However, I just pushed up a new installer that should also install this package. Its difficult to test as I don’t have a machine that does not have this already installed, but I saw the install run on my machine so at least I know its running.

Thanks

1 Like

TYSM it worked! Do you know where is the documentation or a tutorial to start making some paths?

Documentation should be available via Help/Documentation as best it is.

1 Like

yeah the thing is I press the button but nothing happens :S

What platform? Windows, Mac, Linux?

Assuming windows? What version? 10?

1 Like

yup

Can we move this to GitHub as a better tracker for issues? I created a new issue there .

Thanks
sjcbulldog

1 Like

As a short introduction do the following:

First, Go to the menu item Robots/New Robot to create a new robot. Fill in the information on the robot as best you can. Note the Effective Width/Length is either the tire to tire width and length of the robot, or if you have characterized a narrower effective width then this narrower width. The Physical Width and Length is the bumper to bumper width and length and is used to positioning the robot on the field. Note only TankDrive is supported.

Then Right Click in the upper right Paths window and select New Path Group. A path group is a group of paths that belong together, usually an automode. Right Click the New Group and select New Path. You can double click the group or path to rename.

Once a path is created, if you select it you will see it on the screen. You can click on the orange triangles to select a waypoint. You can click on a waypoint and drag it to a new location. When a waypoint is selected its properties are seen in the lower right hand window. They can be edited there as well. When a waypoint is selected, you can grab the circular handle to rotate the waypoint. The arrow keys will also move a waypoint and the + and - keys will rotate. Holding down shift while pressing arrows keys or +/- will slow the motion or rotation.

Use the Games menu to select the image for the playing field.

Use the Generator menu to select path specific algorithm for path generation. Overall I like the one from the Cheesy Poofs.

The Window below the field should show the position, velocity, and acceleration of the robot along the path.

1 Like