Coder Social home page Coder Social logo

odio_urdf's People

Contributors

doomerdinger avatar hauptmech 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

Watchers

 avatar  avatar  avatar

odio_urdf's Issues

Sequential style passing items as args

It would be great if when using "sequential style" you could pass in compatible types as args. So a link for a parent for example.

From your example:

my_robot = Robot()
link1 = Link() #name 'link1' will be used unless link1.name is set 

my_robot(link1)

# Standard
base = Parent("link1")
joint1 = Joint(base, Child("link2"), type="continuous") 

# What I propose
joint1 = Joint(link1, Child("link2"), type="continuous") 

# Or
joint1 = Joint(Parent(link1), Child("link2"), type="continuous") 

# Alternatively
base = Parent(link1)
joint1 = Joint(base, Child("link2"), type="continuous") 

my_robot(joint1)

print(my_robot)

It can be kind of cumbersome to type out all the various strings of names, when they are already defined by links declared earlier.

This has particular use with how I am trying to use odio where the actual link names can be significantly longer than the logical names.

Can't run bullet with the URDF

Hi,

I ran your init script for creating a basic URDF file.
Then I tried to load this URDF file into the bullet env.
I got the following error:
image
Do you have any clue?

Need help loading an existing URDF to add more tags to it

I read the existing URDF file using the xml.etree.ElementTree and converted it into an xml string using,

xmlstr = ET.tostring(root, encoding='utf8', method='xml')

However when I tried using the urdf_to_odio(urdf_string) with it, it just returns the same string.
Could you please provide an example on loading an existing URDF to add new tags to it or is there an example already available somewhere?

Edit

The returned string is in the odio_urdf DSL and copy pasting the entire string initialises the URDF in odio_urdf form and can be edited as needed

Load Xacro to Group instead of Robot

My issue is a bit more complicated than the title implies, but generally boils down to it.

I am trying to make a robot that pulls from multiple files. Those files provide a Group back to the main file which aggregates them in a Robot object. Some of those Group files are defined entirely with odio, but some compose xacro files into odio by running xacro directly and storing the output.

The xacro_xml arg that can be used with Robot cannot be used here, as I have to use a group. Or I can use a Robot and then discard the top level tags so I can convert it to a Group but I can't figure out how to make that happen.

I've resorted to running xacro,parsing the result in element tree, iterating over it, appending it all to the xmltext of the group, then in the top level file doing

my_robot(my_group)
my_robot.xmltext += my_group.xmltext

but I'd like the group to be a fully fledged odio object. Am I missing something here?

bdist_wheel fails after the recent changes

Hi,
I install this package using the below comand for my application

pip install git+https://github.com/hauptmech/odio_urdf.git

It is failing from today with the below error. I am hoping this is due to the recent changes merged. Can you please advise on this ?

Error Message
Looking in indexes: https://pypi.python.org/simple/
Collecting git+https://github.com/hauptmech/odio_urdf.git
Cloning https://github.com/hauptmech/odio_urdf.git to /tmp/pip-req-build-cteq9uv9
Running command git clone -q https://github.com/hauptmech/odio_urdf.git /tmp/pip-req-build-cteq9uv9
Building wheels for collected packages: odio-urdf
Building wheel for odio-urdf (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-cteq9uv9/setup.py'"'"'; file='"'"'/tmp/pip-req-build-cteq9uv9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-7pw6de0u
cwd: /tmp/pip-req-build-cteq9uv9/
Complete output (18 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/odio_urdf
copying odio_urdf/init.py -> build/lib/odio_urdf
copying odio_urdf/main.py -> build/lib/odio_urdf
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/odio_urdf
copying build/lib/odio_urdf/init.py -> build/bdist.linux-x86_64/wheel/odio_urdf
copying build/lib/odio_urdf/main.py -> build/bdist.linux-x86_64/wheel/odio_urdf
running install_egg_info
error: error in 'egg_base' option: '' does not exist or is not a directory

ERROR: Failed building wheel for odio-urdf
Running setup.py clean for odio-urdf
Failed to build odio-urdf
Installing collected packages: odio-urdf
Running setup.py install for odio-urdf ... error
ERROR: Command errored out with exit status 1:
command:venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-cteq9uv9/setup.py'"'"'; file='"'"'/tmp/pip-req-build-cteq9uv9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ofubhb7u/install-record.txt --single-version-externally-managed --compile --install-headers /venv/include/site/python3.6/odio-urdf
cwd: /tmp/pip-req-build-cteq9uv9/
Complete output (15 lines):
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/odio_urdf
copying odio_urdf/init.py -> build/lib/odio_urdf
copying odio_urdf/main.py -> build/lib/odio_urdf
running install_lib
copying build/lib/odio_urdf/init.py -> /venv/lib/python3.6/site-packages/odio_urdf
copying build/lib/odio_urdf/main.py -> /venv/lib/python3.6/site-packages/odio_urdf
byte-compiling /venv/lib/python3.6/site-packages/odio_urdf/init.py to init.cpython-36.pyc
byte-compiling /venv/lib/python3.6/site-packages/odio_urdf/main.py to main.cpython-36.pyc
running install_egg_info
error: error in 'egg_base' option: '' does not exist or is not a directory
----------------------------------------
ERROR: Command errored out with exit status 1: /venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-cteq9uv9/setup.py'"'"'; file='"'"'/tmp/pip-req-build-cteq9uv9/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /tmp/pip-record-ofubhb7u/install-record.txt --single-version-externally-managed --compile --install-headers

Xacro macro compatibility

I'm curious about how compatible this library is with xacro, specifically concerning macros.

I see there are a couple examples of importing xacro files, but none of those files have macros defined. If an included xacro file has a macro, is there any way for this library to parse that macro and allow the calling of that macro, allowing us to specify xacro macro arguments?

I would like to at least try this tool, but if it can't work with existing xacro macros that provides a significant barrier (as some of the macros I want to use are defined in packages I do not control, and would prefer to not remake them with this tool so any further changes to those external macros are properly updated without additional effort)

Readme example code crashes

The example code in the readme crashes. This is the output:

Traceback (most recent call last):
  File "/home/ags/python_modules/odio_urdf/test.py", line 5, in <module>
    Link(name="link1"),
  File "/usr/local/lib/python2.7/dist-packages/odio_urdf/__init__.py", line 315, in __init__
    super().__init__(*args,**kwargs)
TypeError: super() takes at least 1 argument (0 given)

New release/tag?

Hello @hauptmech, long time no see!

Thanks for working on odio_urdf! A few members of my lab are using it. For reproducibility reasons, once we release the code related to a pubblication, we freeze/pin dependencies. Technically, we can do that with any commit, but for several reasons (mainly being able to get with version is use simply via pip list or similar) we prefer to depend on release/tag instead of just an arbitrary commit. So I was wondering if you were interested in making a tag out of the latest commit on master branch.

In any case, thanks a lot in advance!

fyi @FabioBergonti @akhilsathuluri

test_coman file crashes

ags@xxx:~/python_modules/odio_urdf/test$ ./test_coman 
Traceback (most recent call last):
  File "coman/coman.py", line 33, in <module>
    grey =      Material(Color(rgba="0.5 0.5 0.5 1"))
  File "<string>", line 497, in __init__
NameError: global name 'self' is not defined

The same thing happens with python3 on my system:

ags@xxx:~/python_modules/odio_urdf/test/coman$ python3 coman.py
Traceback (most recent call last):
  File "coman.py", line 33, in <module>
    grey =      Material(Color(rgba="0.5 0.5 0.5 1"))
  File "<string>", line 497, in __init__
NameError: name 'self' is not defined

creating new elements end tag does not match

When trying to create new elements the end tag sometimes does not match the start tag. If I create a new element named hardwareInterface, the end tag makes hardwareinterface. As you can see it made the entire word lower case. It appears the code is changing it to lower case. Also the transmission joint tag comes through as follows: <joint name="joint_1>. I tried a work around by creating my own elements, then I ran into the code making my end tag lower case.

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.