Closed yijiangh closed 3 years ago
The pybullet assigned id is attached to the internal cached_robot
and not an instance of compas_fab.robots.Robot
or its compas_fab.robots.Robot.model
. The cached_robot
is an instance of compas.robots.RobotModel
that is based on the compas_fab.robots.Robot.model
but can be modified by the PyBullet
client, and when it is, the pybullet id changes. So in a sense, yes, the user is working with the cached_robot
, but we try to keep it behind the scenes as much as possible.
For me, the redirect_stdout
is working. There is an exception to when it is enabled even if verbose=False
is given, and that's when code is being run with pytest.
The pybullet assigned id is attached to the internal cached_robot and not an instance of compas_fab.robots.Robot or its compas_fab.robots.Robot.model.
Thanks for the explanation! So this is the canonical way to obtain the pybullet index of a given robot instance?
robot_uid = client.get_uid(client.get_cached_robot(robot))
For me, the redirect_stdout is working. There is an exception to when it is enabled even if verbose=False is given, and that's when code is being run with pytest.
Aha, I am exactly encountering this with pytest 😃
Thanks for the explanation! So this is the canonical way to obtain the pybullet index of a given robot instance?
robot_uid = client.get_uid(client.get_cached_robot(robot))
Yep.
I tried for a while to make redirect_stdout and pytest play together nicely, but couldn't manage.
Thanks! I guess not many users would need to access the pybullet body index, except for someone who is working on backend features 😄
When I run the following script using
PybulletClient
at version 0.18.0:It doesn't work because
robot
does not have the attributeattr
.The following script does work though:
This makes me wonder if this line and the lines followed should use
robot.attr
instead ofrobot.attributes
? https://github.com/compas-dev/compas_fab/blob/main/src/compas_fab/backends/pybullet/client.py#L187@beverlylytle Is this intended behavior to have users always work with the cached robot? Thanks!
Also, would you mind confirming that
redirect_stdout
is working (this line)?When loading the robot with
verbose=False
, I still get the following printous: