Hi i tried this quiz and i am getting really frustrated because i can’t find the solution to the probelm.
according to the make and the linter it says goal is not
because at first i thought it was something with string so i changed the custom action to
here are my c code, xml and make file if someone knows the answer pleas let me know.
am i doing something wrong or what is the case here.
might be a stupid question but i just don’t get it.
looking forward to your response
best regards
Joni0131
goal should be string , and u just have to check whether the input goal is equal to the condition .
i.e if goal == ‘TAKEOFF’:
(block of code to be executed if the condition is true)
I think it should have been a string
instead of int32
since the quiz wanted us to send “TAKEOFF” or “LAND” from our action client, and using int32 wont solve it.
Yeah i know but the same error occurd when using string so i thought maybe i can unsderstand it better when using int32 as in the fibonacci example
I saw this but because i was getting the same error for a string i tried to reduce my code to the minimum so it can compile but it still is not working so i asked if someone has a reaso for ther error that occurse when compiling the c code here as seen in the first picture
To be fair, I am still new to C++, but from what I understand from your program is that you have not even initiated any action server yet? You should create an object of type CustomActionMsgAction
. Maybe the following should solve the issue?
int main(int argc, char **argv) {
ros::init(argc, argv, "action_custom_msg_as");
CustomActionMsgAction customAction("/action_custom_msg_as");
ros::spin();
return 0;
}
Also, in order for it to work, you need to create your constructor. Something along this line.
customActionMsgAction(std::string name)
: action_server_(nh_, name,
boost::bind(&customActionMsgAction::executeCallback, this, _1),
false),
action_name_(name) {
action_server_.start();
}
The constructor will start your action server and you should be able to check if your action server is up and running with
rostopic list | grep <insert_your_action_server_name>