Giter VIP home page Giter VIP logo

Comments (4)

manumerous avatar manumerous commented on May 23, 2024

As can be seen here we actually pass the log as a relative path and then in the function automatically uses the current working directory to generate the needed absolute path to interface with the pyulog library to load the ulog. Not sure if it is possible to pass a relative path to the library.

As far as I know the os.getcwd() function gets the current working directory from an environmental variable. Could it be that you somewhere change this variable in your process to /home/jaeyoung? As far as I know we should not expect a different behaviour of this method between ubuntu 20.04 and 18.04.

Furthermore I have tried to run the application without the virtual environment and it still works for me. So we can exclude that as a source of the error.

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 23, 2024

@manumerous I have always been running the script from the root of the repo (never cd-ing into the parametric_model directory).

Does it work for you this way? Can you also not reproduce it when using the docker environment?

from data-driven-dynamics.

manumerous avatar manumerous commented on May 23, 2024

The problem is that currently the code takes the current working directory, goes back two directories and then searches the logs relative from there. As can be seen in code.

Therefore it fails when the python script is run using the Makefile, because the project directory will be the current working directory.

In contrast it works when directly calling the script using e.g. python3 generate_parametric_model.py simple_quadrotor_model logs/2021-04-12/14_28_28.ulg, because in that case the current working directory will always be the directory where generate_parametric_model.py is in regardless from where the script is called.

I guess we should either converge on one way of running the script or adapt load_ulog() to check for this. I think it would be good to do the latter anyways. But the former also makes sense.

from data-driven-dynamics.

Jaeyoung-Lim avatar Jaeyoung-Lim commented on May 23, 2024

@manumerous Okay now it makes more sense.

The script is assuming that the "current" directory is somewhere in the project. While it should always take the relative directory to where the user is running the directory (unless it is an absolute path).

Therefore, a more correct path is

python3 generate_parametric_model.py simple_quadrotor_model ../../logs/2021-04-12/14_28_28.ulg

Since the logs directory is not under the parametric_model directory

from data-driven-dynamics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.