Skip to content

Commit

Permalink
Fix segfault with vpThetaUVector and std::vector based-constructor.
Browse files Browse the repository at this point in the history
  • Loading branch information
s-trinh committed May 10, 2024
1 parent 5afa2c1 commit 7b94547
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion modules/core/src/math/transformation/vpThetaUVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ vpThetaUVector::vpThetaUVector(double tux, double tuy, double tuz) : vpRotationV
/*!
Build a \f$\theta {\bf u}\f$ vector from a vector of 3 angles in radian.
*/
vpThetaUVector::vpThetaUVector(const std::vector<double> &tu) { buildFrom(tu); }
vpThetaUVector::vpThetaUVector(const std::vector<double> &tu) : vpRotationVector(3) { buildFrom(tu); }

/*!
Converts an homogeneous matrix into a \f$\theta {\bf u}\f$ vector.
Expand Down
3 changes: 1 addition & 2 deletions modules/core/test/tools/io/testNPZ.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ TEST_CASE("Test visp::cnpy::npy_load/npz_save", "[visp::cnpy I/O]")
u[2] = i*4 + 2;
u.normalize();
double theta = vpMath::rad(5*i + 2);
std::vector<double> vec { theta*u[0], theta*u[1], theta*u[2] };
vpThetaUVector tu(vec[0], vec[1], vec[2]);
vpThetaUVector tu(std::vector<double>{ theta *u[0], theta *u[1], theta *u[2] });
// std::cout << "theta=" << tu.getTheta() << " ; u=" << tu.getU().transpose() << std::endl;

vpTranslationVector trans(i*4 + 10, i*4 + 20, i*4 + 30);
Expand Down

0 comments on commit 7b94547

Please sign in to comment.