Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[choreo] Adds CLI support for generating trajectories #602

Merged
merged 65 commits into from
Sep 2, 2024

Conversation

oh-yes-0-fps
Copy link
Collaborator

Closes #36

Not a final implementation

If no args are provided it will launch GUI despite what help says

Usage: Choreo.exe [OPTIONS] --chor <path/to/myproject.chor>

Options:
  -g, --generate
  -h, --help      Print help

File Options:
      --chor <path/to/myproject.chor>
      --traj <test> //supports multiple inputs

Formating Options:
  -f, --format <(pretty|json|slim)>  [default: slim]

right now you need a --chor, at least 1 --traj and -g for it to do anything

@oh-yes-0-fps oh-yes-0-fps marked this pull request as ready for review August 28, 2024 23:20
@oh-yes-0-fps
Copy link
Collaborator Author

Added the ability to open Choroe by doing Choreo --chor path/to/myProject.chor

I also overhauled the Tauri Commands to make them more isolated and reduce the reliance on absolute paths in the frontend.

More work still needs to be done on the frontend to make it follow this paradigm

shueja
shueja previously requested changes Aug 29, 2024
src-tauri/src/app/cli.rs Outdated Show resolved Hide resolved
src-tauri/src/app/cli.rs Outdated Show resolved Hide resolved
if (traj) {
await Commands.renameTraj(traj.serialize, newName)
.then((new_traj) => {
doc.pathlist.addPath(newName, true, new_traj);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do with the old path?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is just deleting the old one from the pathlist appropriate?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I don’t see the benefit of deleting and tea-adding over just changing the name. For one thing, you won’t be able to keep the same waypoint selected through the delete and readd

src/document/tauriTracing.ts Outdated Show resolved Hide resolved
* @param optionalParams Additional parameters to be logged.
*/
export function TraceError(message: any, ...optionalParams: any[]): void {
console.log(message, optionalParams);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be console.error

@shueja shueja mentioned this pull request Aug 29, 2024
@oh-yes-0-fps
Copy link
Collaborator Author

Choreo CLI

Usage: Choreo [OPTIONS]

Options:
  -h, --help     Print help
  -V, --version  Print version

File Options:
      --chor <path/to/myproject.chor>
      --traj <trajName1,trajName2>     Adds trajectories to be used by cli actions
      --all-traj                       The same as doing --traj for all trajectories in the project

Action Options:
  -g, --generate  Generate the provided trajectories for the project

Advanced Options:
  -f, --free       Free the process to run in another process and return immediately
      --ipc <IPC>  A serialized IPC handle to the parent process
2024-08-29.13-44-56.mp4

@calcmogul calcmogul changed the title [choroe] Adds cli support for generating trajectories [choreo] Adds CLI support for generating trajectories Aug 29, 2024
@oh-yes-0-fps
Copy link
Collaborator Author

oh-yes-0-fps commented Sep 1, 2024

#624 and #597 are technically implemented in this too although idc if those get merged first

@calcmogul
Copy link
Member

calcmogul commented Sep 1, 2024

This PR broke for me when generating a trajectory with two waypoints in the GUI. I get the following error and no trajectory.

INFO | 21:23:33.048| src/tauri.rs:60                 | Starting Choreo Gui
TRACE| 21:23:33.049| unknown:-1                      | registering event source with poller: token=Token(1), interests=READABLE

** (choreo:2334484): WARNING **: 14:23:33.148: webkit_settings_set_enable_offline_web_application_cache is deprecated and does nothing.
TRACE| 21:23:34.309| unknown:-1                      | registering event source with poller: token=Token(1), interests=READABLE
DEBUG| 21:23:35.553| src-core/src/file_management/mod.rs:154| Setting deploy path to 
DEBUG| 21:24:11.578| DocumentManager.ts:509          | generateWithToastsAndExport 046f3e8c-e818-458e-a456-e826e3ecb7e2
DEBUG| 21:24:11.578| chunk-6OOF5XIV.js:1117          | generatePathWithToasts 046f3e8c-e818-458e-a456-e826e3ecb7e2
dt estimate: 0.1 - total time estimate: 1.540249126749439
ERROR| 21:24:11.605| react-toastify.js:114           | generatePathWithToasts: TypeError: undefined is not an object (evaluating 'caller.includes')

@oh-yes-0-fps
Copy link
Collaborator Author

This PR broke for me when generating a trajectory with two waypoints in the GUI. I get the following error and no trajectory.

May be a linux only issue?

2024-09-01.17-41-09.mp4

@oh-yes-0-fps
Copy link
Collaborator Author

The only thing left in this pr that's blatantly non-functional is frontend tracing locations on webkit

@shueja shueja merged commit 693afef into SleipnirGroup:main Sep 2, 2024
25 checks passed
spacey-sooty pushed a commit to spacey-sooty/Choreo that referenced this pull request Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[choreo] Saving a new project then reopening Choreo does not reopen the project Add commandline interface
4 participants