Open louk-spaceman opened 9 months ago
This is a really painful issue that is caused by the broken ecosystem of TrajectoryOptimization.jl
, RobotDynamics.jl
and Altro.jl
. You may keep running into issues, i'm really sorry about this. When I wrote this, all of these packages were in development.
Are you activating the environment in the root directory? In theory this should have all the correct versions saved, I think I was using Julia 1.5.4 at the time (https://julialang.org/downloads/oldreleases/).
If you want to keep trying your current method, try this:
RD.state_dim(::KSopt) = 14
RD.control_dim(::KSopt) = 3
Hi Kevin, thanks for your response! I'm not a Julia expert, so bear with me, but when I tried to instantiate the KSLowThrust package, it failed to precompile about half of the dependencies. I had to manually Pkg.add() a lot of them from their respective GitHub repositories. I think this process gave me the newest versions, rather than the ones specified in the manifest. I will see if I can't try running this using an older version of Julia, and report back. Perhaps that is the reason instantiation failed.
Trying your values for state_dim and control_dim, unfortunately I received another error – although, it was different, at least!
ERROR: LoadError: MethodError: no method matching RobotDynamics.DiscretizedDynamics(::KSopt, ::RobotDynamics.RK4)
Closest candidates are:
RobotDynamics.DiscretizedDynamics(::L, ::Q) where {L<:RobotDynamics.ContinuousDynamics, Q<:RobotDynamics.QuadratureRule}
@ RobotDynamics ~/.julia/packages/RobotDynamics/baZMh/src/discretized_dynamics.jl:172
Stacktrace:
[1] Problem(::KSopt, ::Objective{QuadraticCost{14, 3, Float64, Diagonal{Float64, SVector{14, Float64}}, Diagonal{Float64, SVector{3, Float64}}}}, ::Vararg{Any}; integration::RobotDynamics.RK4, kwargs::@Kwargs{x0::SVector{14, Float64}, constraints::ConstraintList})
@ TrajectoryOptimization ~/.julia/packages/TrajectoryOptimization/cGEqd/src/problem.jl:115
[2] top-level scope
@ ~/TrajectoryCalculations/KSLowThrust/conference_examples/60_day_transfer.jl:97
in expression starting at /Users/lg/TrajectoryCalculations/KSLowThrust/conference_examples/60_day_transfer.jl:97
Can you get the quickstart working? https://github.com/RoboticExplorationLab/TrajectoryOptimization.jl/blob/main/examples/quickstart.jl
I imagine I might have been able to, had I tried before removing Julia 1.10 and installing 1.5.4. I had a few similar scripts running, performing integration with the Altro solver, such as RobotZoo.yakplane. I am currently working on getting everything up and running on 1.5.4 so I will keep you posted. I edited this comment to remove an incorrect assumption I had made before I left for lunch, so sorry for any confusion.
I was able to run quickstart.jl on Julia 1.5.4 successfully, but still no luck on 60_day_transfer.jl.
You can start moving the problem over from 60_day_transfer.jl
to quickstart.jl
. All of the features used in the former are also in the latter. Does that make sense?
That does make sense, yes. I will attempt to transfer the problem over, but I'm not sure my understanding of the code is great enough to achieve it.
I received this error:
Not sure what went wrong here, but I think it's something to do with new versions of all the Julia packages KSLowThrust depends on. I've tried a few things, and seemingly made some progress, but haven't been able to actually solve the issue. For one, I tried formatting things a little differently to match the new style which seems to be that you exchange:
for:
But then this gives me a new error:
So I dealt with this by giving it what it wanted (with more or less random values to just see if I could get the code to run):
Which seemed to cause that error to go away, but it was replaced with a new one:
Any clue what the solution to all this is? Any help would be greatly appreciated! I believe once this issue is resolved, the codebase would be more or less updated to work with the newest versions of all its dependencies, so it may be a worthy pursuit.