trouble with isExpired()
I can not figure out how to use isExpired
function from actionlib
. The first line is what the documentation tells me to use. spotted is my action name and marker is the package its located in. The second line is what I think is right, but I can't get it to compile (with spottedAction
, spottedActionGoal
, spottedGoal
).
actionlib::ClientGoalHandle<ActionSpec>::isExpired()
actionlib::ClientGoalHandle<marker::spotted.....>::isExpired()
Thanks :)
when using actionlib::ClientGoalHandle<marker::spottedAction>::isExpired()
Errors << control:make /home/ros-industrial/ros_ws/logs/control/build.make.009.log /home/ros-industrial/ros_ws/src/nov_ros/control/src/nodes/seq_node.cpp: In function ‘int main(int, char)’: /home/ros-industrial/ros_ws/src/nov_ros/control/src/nodes/seq_node.cpp:206:91: error: cannot call member function ‘bool actionlib::ClientGoalHandle<actionspec>::isExpired() const [with ActionSpec = marker::spottedAction_<std::allocator<void> >]’ without object if (actionlib::ClientGoalHandle<marker::spottedaction>::isExpired()) { ^ make[2]: [CMakeFiles/seq_node.dir/src/nodes/seq_node.cpp.o] Error 1 make[1]: [CMakeFiles/seq_node.dir/all] Error 2 make: * [all] Error 2
Can you please update your question with the errors that you're getting (using the preformatted text (
101010
) button)I figured out the 101010 button too late. when i use spottedAction, i get "
cannot call member function 'bool actionlib::ClientGoalHandle<actionspec>::isExpired() const' without object
when i use spottedActionGoal, i get
required from here
no type named '_action_goal_type' in 'struct marker::spottedActionGoal_<std::allocator<void> >'
and a whole bunch of other "no type name...".
when I use spottedGoal, i get the basically same thing as using spottedActionGoal
Can you please post with full error?
when using
actionlib::ClientGoalHandle<marker::spottedAction>::isExpired()
Errors << control:make /home/ros-industrial/ros_ws/logs/control/build.make.009.log /home/ros-industrial/ros_ws/src/nov_ros/control/src/nodes/seq_node.cpp: In function ‘int main(int, char)’: /home/ros-industrial/ros_ws/src/nov_ros/control/src/nodes/seq_node.cpp:206:91: error: cannot call member function ‘bool actionlib::ClientGoalHandle<actionspec>::isExpired() const [with ActionSpec = marker::spottedAction_<std::allocator<void> >]’ without object if (actionlib::ClientGoalHandle<marker::spottedaction>::isExpired()) { ^ make[2]: [CMakeFiles/seq_node.dir/src/nodes/seq_node.cpp.o] Error 1 make[1]: [CMakeFiles/seq_node.dir/all] Error 2 make: * [all] Error 2
Please don't use comments to give more information, please update your question instead
The problem is you're trying to call the method as if it was a static method without an object instance. You need to call this on an actual instance of
actionlib::ClientGoalHandle