Callback of actionlib_msgs::GoalStatusArray fails
Hi,
I am writing a node that subscribes to an actionlib_msgs::GoalStatusArray message. The callback code is:
move_base_status_sub = n.subscribe<actionlib_msgs::GoalStatusArray>("/move_base/status", 50, &rviz_text::move_base_statusCallback, this);
...
void rviz_text::move_base_statusCallback(const actionlib_msgs::GoalStatusArrayConstPtr& msg)
{
actionlib_msgs::GoalStatusArray status_array = *msg;
uint32_t sequence = status_array.header.seq;
// sequence is read successfully
actionlib_msgs::GoalStatus status_list_entry = status_array.status_list[0];
// status_list_entry is read unsuccessfully. The above line causes a seg fault at runtime.
}
I am able to read the header of the GoalStatusArray, but unable to read the status_list array. I get a segmentation fault when doing so.
I seem to be doing an error when trying to access the first element of status_array.status_list. Do you see any syntax error in my code?
The GoalStatusArray and GoalStatus messages definitions can be found on:
My callback function is subscribing to the /move_base/status topic. The messages on this topic look like the following:
---
header:
seq: 52
stamp:
secs: 1400564326
nsecs: 841550350
frame_id: ''
status_list:
-
goal_id:
stamp:
secs: 1400564318
nsecs: 321941901
id: /move_base-1-1400564318.321941901
status: 1
text: This goal has been accepted by the simple action server
---
My setup:
- ROS fuerte
- Ubuntu 12.04
Do you have a clue why my code is failing?