GithubHelp home page GithubHelp logo

allanzhao / robogrammar Goto Github PK

View Code? Open in Web Editor NEW
202.0 202.0 64.0 6.25 MB

RoboGrammar: Graph Grammar for Terrain-Optimized Robot Design (SIGGRAPH Asia 2020)

Home Page: https://cdfg.mit.edu/publications/robogrammar-graph-grammar-for-terrain-optimized-robot-design

License: MIT License

CMake 1.56% Dockerfile 0.35% C++ 90.20% GLSL 2.82% Python 5.08%

robogrammar's People

Contributors

allanzhao avatar eanswer avatar fabberdabber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

robogrammar's Issues

maybe some mistakes when running your tutorial

  1. The name of your root directory is 'RoboGrammar', not 'robot_design'.
  2. When running your C++ examples, I found there was no viewer, only rule_viewer, and the file called insect.dot was in '../rl/data/designs', not '../data/designs'.
  3. When I copied your command for playing python example, the terminal showed the error 'Rule in sequence has no applicable matches'.

Python.h

Hi I am trying to emulate your experiment but it seems that the Python.h error occurs everytime I run the following command

make -j8

I tried fixing the broken packages and all the python stuff, and then rebuild the code again but no matter what I do, it still gives me the same error. Please let me know what I am doing wrong or is the Python.h file missing from the repository or anything else.

Error:


In file included from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pytypes.h:12:0,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/cast.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/attr.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pybind11.h:44,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/numpy.h:12,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/eigen.h:12,
                 from /home/omkar/RoboGrammar/examples/python_bindings/py_graph.cpp:1:
/home/omkar/RoboGrammar/extern/pybind11/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
 #include 
          ^~~~~~~~~~
compilation terminated.
examples/python_bindings/CMakeFiles/pyrobotdesign.dir/build.make:86: recipe for target 'examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_graph.cpp.o' failed
make[2]: *** [examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_graph.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pytypes.h:12:0,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/cast.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/attr.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pybind11.h:44,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/numpy.h:12,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/eigen.h:12,
                 from /home/omkar/RoboGrammar/examples/python_bindings/py_optim.cpp:1:
/home/omkar/RoboGrammar/extern/pybind11/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
 #include 
          ^~~~~~~~~~
compilation terminated.
examples/python_bindings/CMakeFiles/pyrobotdesign.dir/build.make:110: recipe for target 'examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_optim.cpp.o' failed
make[2]: *** [examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_optim.cpp.o] Error 1
In file included from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pytypes.h:12:0,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/cast.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/attr.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pybind11.h:44,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/numpy.h:12,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/eigen.h:12,
                 from /home/omkar/RoboGrammar/examples/python_bindings/py_render.cpp:1:
/home/omkar/RoboGrammar/extern/pybind11/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
 #include 
          ^~~~~~~~~~
compilation terminated.
examples/python_bindings/CMakeFiles/pyrobotdesign.dir/build.make:158: recipe for target 'examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_render.cpp.o' failed
make[2]: *** [examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_render.cpp.o] Error 1
In file included from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pytypes.h:12:0,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/cast.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/attr.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pybind11.h:44,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/numpy.h:12,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/eigen.h:12,
                 from /home/omkar/RoboGrammar/examples/python_bindings/py_robot.cpp:2:
/home/omkar/RoboGrammar/extern/pybind11/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
 #include 
          ^~~~~~~~~~
compilation terminated.
examples/python_bindings/CMakeFiles/pyrobotdesign.dir/build.make:182: recipe for target 'examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_robot.cpp.o' failed
make[2]: *** [examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_robot.cpp.o] Error 1
In file included from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pytypes.h:12:0,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/cast.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/attr.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pybind11.h:44,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/numpy.h:12,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/eigen.h:12,
                 from /home/omkar/RoboGrammar/examples/python_bindings/py_prop.cpp:2:
/home/omkar/RoboGrammar/extern/pybind11/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
 #include 
          ^~~~~~~~~~
compilation terminated.
examples/python_bindings/CMakeFiles/pyrobotdesign.dir/build.make:134: recipe for target 'examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_prop.cpp.o' failed
make[2]: *** [examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_prop.cpp.o] Error 1
In file included from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pytypes.h:12:0,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/cast.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/attr.h:13,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/pybind11.h:44,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/numpy.h:12,
                 from /home/omkar/RoboGrammar/extern/pybind11/include/pybind11/eigen.h:12,
                 from /home/omkar/RoboGrammar/examples/python_bindings/py_eigen_geometry.cpp:2:
/home/omkar/RoboGrammar/extern/pybind11/include/pybind11/detail/common.h:112:10: fatal error: Python.h: No such file or directory
 #include 
          ^~~~~~~~~~
compilation terminated.
examples/python_bindings/CMakeFiles/pyrobotdesign.dir/build.make:62: recipe for target 'examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_eigen_geometry.cpp.o' failed
make[2]: *** [examples/python_bindings/CMakeFiles/pyrobotdesign.dir/py_eigen_geometry.cpp.o] Error 1
CMakeFiles/Makefile2:1256: recipe for target 'examples/python_bindings/CMakeFiles/pyrobotdesign.dir/all' failed
make[1]: *** [examples/python_bindings/CMakeFiles/pyrobotdesign.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 98%] Linking CXX executable RuleViewer
[ 98%] Built target RuleViewer
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

graph heuristic search not working

TypeError: forward() takes from 3 to 4 positional arguments but 5 were given

I always get the above mentioned error when i try running graph heuristic search. any suggestions to correct it?

argument error when runing examples/design_search/viewer.py

Hi, got this error when I ran the example code. Any helps or hints about it? Thanks!

Using optimization seed: 360342674
Traceback (most recent call last):
File "examples/design_search/viewer.py", line 258, in
main()
File "examples/design_search/viewer.py", line 156, in main
input_sequence, result = simulate(robot, task, opt_seed, args.jobs,
File "/home/wenhao/2_pytorch_ws/RoboGrammar/examples/design_search/design_search.py", line 124, in simulate
value_estimator.get_observation(main_sim, obs[:,j])
TypeError: get_observation(): incompatible function arguments. The following argument types are supported:
1. (self: pyrobotdesign.ValueEstimator, arg0: pyrobotdesign.Simulation, arg1: numpy.ndarray[float64[m, 1], flags.writeable]) -> None

Invoked with: <pyrobotdesign.NullValueEstimator object at 0x7ff6c8faf930>, <pyrobotdesign.BulletSimulation object at 0x7ff6c8f97b70>, array([], dtype=float64)

something about Robogrammar

sorry to bother you again, but could you upload some files about the exact meaning of each of the numbers . Though i know that the numbers are a sequence of grammar rules, it is quite confusing when coming to each of the certain number. No any description of the numbers. For example , " 0, 7, 1, 13, 1, 2, 16, 12, 13, 6, 4, 19, 4, 17, 5, 3, 2, 16, 4, 5, 18, 9, 8, 9, 9, 8 -o" . what means 0, what means 7?which part of the body the num represents? how to use numbers to creat a head , a leg ? Thanks a lot .

Broken Dockerfile

I ran into a few issues while trying to build the project using the supplied Dockerfile.

Package Install Order

The first occurs when installing numpy-quaternion. It looks like pip isn't respecting the order of packages (I'm pretty sure pip made a change at some point, but it might be post-python 3.6)

 > [3/9] RUN python3 -m pip install numpy numpy-quaternion:
#6 1.830 Collecting numpy
#6 2.975   Downloading https://files.pythonhosted.org/packages/45/b2/6c7545bb7a38754d63048c7696804a0d947328125d81bf12beaa692c3ae3/numpy-1.19.5-cp36-cp36m-manylinux1_x86_64.whl (13.4MB)
#6 5.191 Collecting numpy-quaternion
#6 5.689   Downloading https://files.pythonhosted.org/packages/9c/58/d3e99c50f76aeae8aec711d2f93387d802486a4ad5c9697f0a1b48eaa018/numpy-quaternion-2022.4.1.tar.gz (59kB)
#6 6.030     Complete output from command python setup.py egg_info:
#6 6.030     Traceback (most recent call last):
#6 6.030       File "<string>", line 1, in <module>
#6 6.030       File "/tmp/pip-build-0nofek86/numpy-quaternion/setup.py", line 16, in <module>
#6 6.030         import numpy as np
#6 6.030     ModuleNotFoundError: No module named 'numpy'

To solve this I separated the package installation to a new line in the Dockerfile, RUN pip3 install numpy-quaternion, which takes advantage of Docker's ordering system.

Missing Files

The second happens when the build starts. When I inspect the contents of /robot_design/extern/glfw it's empty-which is probably the issue at hand. After a while I realized that I should have initialized the git submodules before building-but I think this raises a point that there's no documentation on the Docker process.

 > [ 8/10] RUN cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..:
#12 0.441 -- The C compiler identification is GNU 7.5.0
#12 0.604 -- The CXX compiler identification is GNU 7.5.0
#12 0.620 -- Check for working C compiler: /usr/bin/cc
#12 0.718 -- Check for working C compiler: /usr/bin/cc -- works
#12 0.722 -- Detecting C compiler ABI info
#12 0.823 -- Detecting C compiler ABI info - done
#12 0.842 -- Detecting C compile features
#12 1.148 -- Detecting C compile features - done
#12 1.162 -- Check for working CXX compiler: /usr/bin/c++
#12 1.275 -- Check for working CXX compiler: /usr/bin/c++ -- works
#12 1.276 -- Detecting CXX compiler ABI info
#12 1.396 -- Detecting CXX compiler ABI info - done
#12 1.411 -- Detecting CXX compile features
#12 1.923 -- Detecting CXX compile features - done
#12 1.940 -- Found GLEW: /usr/include (Required is at least version "1.13")
#12 1.947 -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so  found components:  OpenGL
#12 1.948 CMake Error at core/CMakeLists.txt:25 (add_subdirectory):
#12 1.948   The source directory
#12 1.948
#12 1.948     /robot_design/extern/glfw
#12 1.948
#12 1.948   does not contain a CMakeLists.txt file.
#12 1.948
#12 1.948
#12 1.949 CMake Error at core/CMakeLists.txt:34 (add_subdirectory):
#12 1.949   The source directory
#12 1.949
#12 1.949     /robot_design/extern/PEGTL
#12 1.949
#12 1.949   does not contain a CMakeLists.txt file.
#12 1.949
#12 1.949
#12 1.950 CMake Error at core/CMakeLists.txt:41 (add_subdirectory):
FROM ubuntu:18.04
#12 1.950   The source directory
#12 1.950
#12 1.950     /robot_design/extern/tinyxml2
#12 1.950
#12 1.950   does not contain a CMakeLists.txt file.
#12 1.950
#12 1.950
#12 1.951 CMake Error at examples/python_bindings/CMakeLists.txt:8 (add_subdirectory):
#12 1.951   The source directory
#12 1.951
#12 1.951     /robot_design/extern/pybind11
#12 1.951
#12 1.951   does not contain a CMakeLists.txt file.
#12 1.951
#12 1.951
#12 1.951 CMake Error at examples/python_bindings/CMakeLists.txt:9 (pybind11_add_module):
#12 1.951   Unknown CMake command "pybind11_add_module".
#12 1.951
#12 1.951
#12 1.953 -- Configuring incomplete, errors occurred!
#12 1.953 See also "/robot_design/build/CMakeFiles/CMakeOutput.log".

------
executor failed running [/bin/sh -c cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo ..]: exit code: 1

Other Examples

Some of the other examples don't run under the provided environment (missing packages). I would expect all of the examples to work with the image. At the least, pytorch is missing from the dependencies (maybe there could be a requirements.txt)

Provided Example

The Dockerfile, as it is now plus the fixes above, won't successfully run the example because the command line arguments are left out. I was able to copy and paste one of the examples from the main Readme and replace the line in the Dockerfile to make it run.

CMAKE Error fix

If you encounter this error:

CMake Error at extern/glfw/CMakeLists.txt:210 (message):
  The RandR headers were not found


-- Configuring incomplete, errors occurred!
See also "/home/matteogu/Documents/RoboGrammar/build/CMakeFiles/CMakeOutput.log".
See also "/home/matteogu/Documents/RoboGrammar/build/CMakeFiles/CMakeError.log".

Use this fix:
sudo apt-get install xorg-dev libglu1-mesa-dev

Does the graph always have a constant number of nodes?

From my understanding of the code, particularly preprocess.py it looks like the graph always has a constant number of nodes and a mask is used to block empty nodes. Why is this the case? Shouldnt the GNN be able to handle graphs with an arbitray number of nodes?

More details about examples

Excuse me, I'm very interested in this project, but what has confused me for several days is the parameter details.If I want to know the parameters about the robot I have trained,how should I process the logs or where can I view the result?Hoping for your reply, thanks!

UNABLE TO RUN SETUP.PY for PYTHON_BINDINGS

Every time I try to run this command: python3 examples/python_bindings/setup.py develop

I get this error in the terminal and I'm not exactly sure how to fix. I am of the idea that "LIBRARY_NAME" is supposed to be some sort of a placeholder but it seems nothing is being parsed to it.

WARNING: '${LIBRARY_NAME}' not a valid package name; please use only .-separated package names in setup.py
running develop
error: Invalid distribution name or version syntax: -LIBRARY-NAME--0.1.0

Please help!!

Cloning error

Hi
I am getting the error below when trying to follow the instructions on Mac as well as linux. Is there any update that I am missing?

Thanks

(base) dynamic-oit-vapornet100-10-9-60-250:Robogrammar prerit$ sudo git clone [email protected]:allanzhao/robot_design.git
Password:
Cloning into 'robot_design'...
The authenticity of host 'github.com (140.82.113.4)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,140.82.113.4' (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

pyrobotdesign

excuse me, is there a api manual for users to read?

ERROR WHEN RUNNING EXAMPLES

I am unable to run any of the examples due to this error.

Traceback (most recent call last):
File "examples/design_search/viewer.py", line 2, in
from design_search import RobotDesignEnv, make_graph, build_normalized_robot, presimulate, simulate
File "/home/ephson/RoboGrammar/examples/design_search/design_search.py", line 9, in
import pyrobotdesign as rd
ModuleNotFoundError: No module named 'pyrobotdesign'

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.