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

Setting visual in a link bug #42

Open
mutr opened this issue Mar 9, 2019 · 0 comments
Open

Setting visual in a link bug #42

mutr opened this issue Mar 9, 2019 · 0 comments
Labels

Comments

@mutr
Copy link

mutr commented Mar 9, 2019

I found two possible bugs. Opened one issue because I think they are related.

  1. Latest commit broke setting Visual via Link constructor.
  2. <visual> tag are missing in a resulting xml if I created robot from scratch like this:
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import roslib; roslib.load_manifest('urdfdom_py')
>>> from urdf_parser_py.urdf import *
>>> robot = Robot("my_robot")
>>> v = Visual(origin=Pose(xyz=[0.0, 0.0, 0.0], rpy=[0.0, 0.0, 0.0]), geometry=Mesh(filename='package://my.stl'), material=Material(name=""))
>>> l = Link(name='my_link', visual=v)
>>> print(l)
collisions: []
inertial: None
name: my_link
origin: None
visuals: []
>>> # BUG1: visual are empty because setter must be called in a constructor
... l.visual = v # try again manual way
>>> print(l)
collisions: []
inertial: None
name: my_link
origin: None
visuals:
- geometry: {filename: 'package://my.stl', scale: None}
  material: {color: None, name: '', texture: None}
  origin:
    rpy: [0.0, 0.0, 0.0]
    xyz: [0.0, 0.0, 0.0]
>>> robot.add_link(l) 
>>> print(robot.to_xml_string())
<?xml version="1.0"?>
<robot name="my_robot">
  <link name="my_link"/>
</robot>

>>> # BUG2: <visual> are missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants