# Extracting Bezier pathing data

I'm using the bezier package to automatically create a path based on the CAD-file I input. Launching the package with the relevant line:

roslaunch bezier_application fanuc_m20ia_surfacing.launch mesh_cad:=plane/plane.ply mesh_defect:=plane/plane_defect.ply


works and everything, and launches up rviz and the simulation starts. What I'd rather want however, is to somehow extract the actual path data/waypoints that it generates. I've been looking into the bezier sourcecode to see if I can either store the data or intercept it somehow, but so far no luck.

This should be the actual code that receives the path points, but I don't know how to actually extract it. I've tried putting the variable way_points_vector into a ROS_INFO_STREAM to see if I could print it and tried saving it in a text file too, but I get errors when rebuilding the package with catkin build, like:

In file included from /usr/include/c++/5/random:51:0,
from /usr/include/c++/5/bits/stl_algo.h:66,
from /usr/include/c++/5/algorithm:62,
from /usr/include/boost/math/tools/config.hpp:17,
from /usr/include/boost/math/special_functions/round.hpp:13,
from /opt/ros/kinetic/include/ros/time.h:58,
from /opt/ros/kinetic/include/ros/ros.h:38,
from /home/sander/ros_workspaces/beziertest2/src/bezier/bezier_application/src/surfacing.cpp:2:
/usr/include/c++/5/bits/random.tcc:1898:5: note: candidate: template<class _RealType1, class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::normal_distribution<_RealType>&)
operator<<(std::basic_ostream<_CharT, _Traits>& __os,
^
/usr/include/c++/5/bits/random.tcc:1898:5: note:   template argument deduction/substitution failed:
/home/sander/ros_workspaces/beziertest2/src/bezier/bezier_application/src/surfacing.cpp:128:13: note:   ‘EigenSTL::vector_Affine3d {aka std::vector<Eigen::Transform<double, 3, 2>, Eigen::aligned_allocator<Eigen::Transform<double, 3, 2> > >}’ is not derived from ‘const std::normal_distribution<_RealType>’
myfile << way_points_vector;
^


Full error here: https://pastebin.com/4NFDWqnc

Also tried finding anything relevant with rosmsg/rostopic/rosparam, but I coudn't find anything with this either. Is there any way to do this?

edit retag close merge delete

I think your error msg was garbled by previously copy-pasting it. Can you please copy-paste it again and use the Preformatted Text button (the one with 101010 on it) to make sure it survives?

( 2018-05-25 02:33:52 -0500 )edit

I've done that now, it's still looks like a bit of a mess though, see https://i.imgur.com/HhmPEA4.png .

I've uploaded the entire error message on pastebin: https://pastebin.com/4NFDWqnc . But as you can see, it's repetitive.

( 2018-05-25 02:52:28 -0500 )edit

I've done that now, it's still looks like a bit of a mess though

that's just how C++ errors are ('unfortunately' would some people say).

( 2018-05-25 02:55:08 -0500 )edit

In any case: you cannot just pass arbitrary types to ROS_INFO_STREAM(..): only primitives (ie: integer, double, etc) and then only if the proper operators have been defined for them.

If way_points_vector is a vector, then I'd loop over it with an iterator and print individual elements.

( 2018-05-25 02:56:27 -0500 )edit