ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Using custom fields in a ROS service

asked 2017-03-28 14:13:15 -0500

MWrock gravatar image

updated 2017-03-29 01:00:13 -0500

gvdhoorn gravatar image

I'm trying to create a service to handle point clouds. Ideally I'd use a pcl::PointCloud<pcl::PointXYZI> but I'll even settle for sensor_msgs::PointCloud2.

When I try and create my service.srv as:

sensor_msgs::PointCloud2 cloud_in
sensor_msgs::PointCloud2 cloud_out

I get

error: <class 'genmsg.base.InvalidMsgSpec'>: sensor_msgs::PointCloud2 is not a legal message field type


the correct format should be sensor_msgs/PointCloud2 cloud_in

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-28 14:56:29 -0500

huanxiner gravatar image

Try changing sensor_msgs::PointCloud2 to sensor_msgs/PointCloud2.

edit flag offensive delete link more


that was a stupid mistake, thanks!

MWrock gravatar image MWrock  ( 2017-03-28 15:28:53 -0500 )edit

Question Tools


Asked: 2017-03-28 14:13:15 -0500

Seen: 1,131 times

Last updated: Mar 29 '17