Skip to content

Commit

Permalink
Return size as well
Browse files Browse the repository at this point in the history
  • Loading branch information
costashatz committed Sep 7, 2023
1 parent e9ca607 commit f8f3b15
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/python/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <robot_dart/gui/magnum/windowless_graphics.hpp>
#endif

void pointcloud_wrapper(const robot_dart::gui::DepthImage& depth_image, const Eigen::Matrix3d& intrinsic_matrix, const Eigen::Matrix4d& tf, double far_plane, py::array_t<double>& in_results) {
int pointcloud_wrapper(const robot_dart::gui::DepthImage& depth_image, const Eigen::Matrix3d& intrinsic_matrix, const Eigen::Matrix4d& tf, double far_plane, py::array_t<double>& in_results) {
if (in_results.ndim() != 2)
throw std::runtime_error("Results should be a 2-D Numpy array!");

Expand All @@ -25,6 +25,8 @@ void pointcloud_wrapper(const robot_dart::gui::DepthImage& depth_image, const Ei
throw std::runtime_error("Wrong size of Numpy array!");

memcpy(ptr, v_p.data(), v_p.size() * sizeof(double));

return v_p.size();
}

namespace robot_dart {
Expand Down

0 comments on commit f8f3b15

Please sign in to comment.