leggedrobotics / elevation_mapping_cupy

Elevation Mapping on GPU.
MIT License
513 stars 111 forks source link

Call service "check_safety" from c++ client #29

Open lipascal123 opened 2 years ago

lipascal123 commented 2 years ago

Hi there

I would like to call the service "check_safety" from a c++ client. I get the following error message:

Service call failed: service [/elevation_mapping/check_safety] responded with an error: TypeError: Type is mismatched. polygon <class 'numpy.float32'> <class 'numpy.float64'> U

At:
  cupy/_core/_kernel.pyx(559): cupy._core._kernel._decide_params_type_core
  /home/pascal/catkin_ws_nav/src/elevation_mapping_cupy/elevation_mapping_cupy/script/elevation_mapping_cupy/elevation_mapping.py(467): get_polygon_traversability

Here the code snippet for the service call in the c++ node:

 // Collision check
  std::vector<geometry_msgs::PolygonStamped> polys_stamped = convertToPolygonStamped(swath_poly, world_frame_ ,ros::Time::now());
  elevation_map_msgs::CheckSafety srv;
  srv.request.polygons = polys_stamped;
  srv.request.compute_untraversable_polygon = false;
  if(collision_check_client_.call(srv))
    ROS_INFO("Call successful");
  else
    ROS_ERROR("Failed to call service check_safety");

Does anyone have an idea on how to solve this issue? Thanks a lot!

mktk1117 commented 1 year ago

We are checking the issue with safety checker.