Skip to content
Snippets Groups Projects
Commit 9c5964ad authored by Kai Bowers's avatar Kai Bowers
Browse files

Merge branch 'add_interface_for_TransformPolylinePointsFromWorldToLocal_5622110' into 'master'

Add interface function for TransformPolylinePointsFromWorldToLocal

See merge request eclipse/simopenpass/scenario_api!41
parents b07971a7 cb632132
No related branches found
No related tags found
1 merge request!41Add interface function for TransformPolylinePointsFromWorldToLocal
......@@ -17,6 +17,8 @@
#include <MantleAPI/Common/pose.h>
#include <vector>
namespace mantle_api
{
/// Interface that provides functionality to perform geometrical calculations
......@@ -36,6 +38,26 @@ public:
const Vec3<units::length::meter_t>& global_position,
const Orientation3<units::angle::radian_t>& local_orientation,
const Vec3<units::length::meter_t>& local_translation) const = 0;
/// @brief Transforms world polyline positions to local coordinate system.
/// @param polyline_points world polyline points to be transformed
/// @param local_origin local coordinate system origin
/// @param local_orientation local system orientation
/// @return converted polyline points
virtual std::vector<Vec3<units::length::meter_t>> TransformPolylinePointsFromWorldToLocal(
const std::vector<Vec3<units::length::meter_t>>& polyline_points,
const Vec3<units::length::meter_t>& local_origin,
const Orientation3<units::angle::radian_t>& local_orientation) const = 0;
/// @brief Transforms world position to local coordinate system.
/// @param world_position world position to be transformed
/// @param local_origin local coordinate system origin
/// @param local_orientation local system orientation
/// @return transformed point
virtual Vec3<units::length::meter_t> TransformPositionFromWorldToLocal(
const Vec3<units::length::meter_t>& world_position,
const Vec3<units::length::meter_t>& local_origin,
const Orientation3<units::angle::radian_t>& local_orientation) const = 0;
};
} // namespace mantle_api
......
......@@ -43,7 +43,29 @@ public:
std::ignore = local_orientation;
std::ignore = local_translation;
return global_position;
};
}
virtual std::vector<Vec3<units::length::meter_t>> TransformPolylinePointsFromWorldToLocal(
const std::vector<Vec3<units::length::meter_t>>& polyline_points,
const Vec3<units::length::meter_t>& position,
const Orientation3<units::angle::radian_t>& orientation) const
{
// do not transform but return original points
std::ignore = position;
std::ignore = orientation;
return polyline_points;
}
virtual Vec3<units::length::meter_t> TransformPositionFromWorldToLocal(
const Vec3<units::length::meter_t>& point_position,
const Vec3<units::length::meter_t>& position,
const Orientation3<units::angle::radian_t>& orientation) const
{
// do not transform but return original points
std::ignore = position;
std::ignore = orientation;
return point_position;
}
};
class MockConverter : public mantle_api::ICoordConverter
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment