trouble with isExpired()

asked 2019-08-16 08:57:00 -0500

Abigail gravatar image

updated 2019-08-16 20:38:16 -0500

jayess gravatar image

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
edit retag flag offensive close merge delete

Comments

Can you please update your question with the errors that you're getting (using the preformatted text (101010) button)

jayess gravatar imagejayess ( 2019-08-16 10:56:17 -0500 )edit

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

Abigail gravatar imageAbigail ( 2019-08-16 11:13:00 -0500 )edit

Can you please post with full error?

jayess gravatar imagejayess ( 2019-08-16 12:45:29 -0500 )edit

when usingactionlib::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

Abigail gravatar imageAbigail ( 2019-08-16 12:52:58 -0500 )edit

Please don't use comments to give more information, please update your question instead

jayess gravatar imagejayess ( 2019-08-16 13:27:03 -0500 )edit
1

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

PeteBlackerThe3rd gravatar imagePeteBlackerThe3rd ( 2019-08-17 08:04:00 -0500 )edit