service problem
Hi, I defined a server called DetectsObs.srv
float32 x
float32 y
float32 theta
float32 threshold
---
Points obstacles
bool obs
bool processFinished
and two msg type
Point.msg
float32 x
float32 y
and Points.msg
Point[] points
I have a service whose response is obstacle_detection::DetectsObs::Response &res
(obstacle_detection is my package) I want to set the field obstacles of my response but if I do
obstacle_detection::Point obstacle;
obstacle.x = 0;
obstacle.y = 0;
res.obstacles[0] = obstacle;
I get this error
error: no match for ‘operator[]’ in ‘res->obstacle_detection::DetectsObsResponse_<std::allocator<void> >::obstacles[0]’
What should i do to fix it.
Thank you in advance