ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Using custom fields in a ROS service

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

MWrock gravatar image

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

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 -0600

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 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


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

Seen: 944 times

Last updated: Mar 29 '17