Open rydb opened 9 months ago
I'm not too sure about this default, it seems the docs specify that the default should be 0 if unspecified (here), This also seems to be the behavior for the ROS parser
I'm not too sure about this default, it seems the docs specify that the default should be 0 if unspecified (here), This also seems to be the behavior for the ROS parser
looking at the docs them selves:
<limit> (required only for revolute and prismatic joint)
An element can contain the following attributes:
lower (optional, defaults to 0)
An attribute specifying the lower joint limit (in radians for revolute joints, in meters for prismatic joints). Omit if joint is continuous.
upper (optional, defaults to 0)
An attribute specifying the upper joint limit (in radians for revolute joints, in meters for prismatic joints). Omit if joint is continuous.
Omit if joint is continuous.
this implies there are instances where ROS assumes there are no limits like on continuous joints. I suppose it makes sense from a safety sense, but its still inconvenient.
Maybe there should be a JointLimit::unlimited()
then?
Yap there are continuous joints, it's a separate type (not revolute), have a look here.
Now someone could make the case that we could exploit Rust's enum system better and make sure JointLimit
is only contained if the joint is of a variant where it makes sense, but that would make serialization / deserialization a fair bit trickier
One option would be to add a method that returns Option<Range>
based on JointType
like this.
Given that it would complicate the parsing code, it would not necessarily be easy to embed the limit in the JointType
. However, it would probably be the most type-safe way to do it.
Looking at
deserialize.rs
f64
defaults to 0.0, this means the max lower and upper bound is inferred to be 0.0. This means, if a urdf has no explicitely defined joint limit, urdf-rs defaults to the joint not being able to move at allI think
Default
forJointLimit
should be changed to the below to fix that.