Open jcarpent opened 1 year ago
I propose adding new signatures to comply with your needs fully. In the near future, we plan make the API much Eigen friendly.
I stumbled on some other strange issue with interface types, i.e. some numpy
type can't be used whereas the plain python type can be used:
import hppfcl as fcl
from pyrr import Matrix44
transformation = Matrix44.identity(dtype="f4"))
(scale_x, scale_y, scale_z), _, _ = transformation.decompose()
fcl.Box(scale_x, scale_y, scale_z)
> fcl.Box(scale_x, scale_y, scale_z)
E Boost.Python.ArgumentError: Python argument types in
E Box.__init__(Box, numpy.float32, numpy.float32, numpy.float32)
E did not match C++ signature:
E __init__(_object*, Eigen::Matrix<double, 3, 1, 0, 3, 1>)
E __init__(_object*, double, double, double)
E __init__(_object*, hpp::fcl::Box)
E __init__(_object*)
but the following works with type conversion
fcl.Box(float(scale_x), float(scale_y), float(scale_z))
This issue is expected, as float32 values are not directly cast into float64 values. You can rather use:
fcl.Box(np.array([scale_x, scale_y, scale_z]))
Discussed in https://github.com/humanoid-path-planner/hpp-fcl/discussions/422