Chapter9 Action_quiz Issue

I tried to solve this quiz and having issue solving this bug, please help, while I am executing the actions_quiz, it is giving error:, I have tried both ways as suggested in earlier forum, still issue not resolving

ImportError: cannot import name ‘CustomActionMsgFeedback’ from ‘actions_quiz.msg’ (unknown location)


Adding CMakeList.txt file:
cmake_minimum_required(VERSION 3.0.2)

project(actions_quiz)

find_package(catkin REQUIRED COMPONENTS

std_msgs

actionlib_msgs

)

Generate services in the ‘srv’ folder

add_service_files(

FILES

Service1.srv

Service2.srv

)

Generate actions in the ‘action’ folder

add_action_files(

FILES

CustomActionMsg.action

)

Generate added messages and services with any dependencies listed here

generate_messages(

DEPENDENCIES

std_msgs

actionlib_msgs

)

catkin_package(

INCLUDE_DIRS include

LIBRARIES actions_quiz

CATKIN_DEPENDS actionlib_msgs rospy std_msgs

#CATKIN_DEPENDS actionlib_msgs rospy std_msgs

DEPENDS system_lib

)

include_directories(

${catkin_INCLUDE_DIRS}

)

<?xml version="1.0"?> actions_quiz 0.0.0 The actions_quiz package

user

<buildtool_depend>catkin</buildtool_depend>
<build_depend>actionlib</build_depend>
<build_depend>actionlib_msgs</build_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
<build_export_depend>actionlib</build_export_depend>
<build_export_depend>actionlib_msgs</build_export_depend>
<build_export_depend>rospy</build_export_depend>
<build_export_depend>std_msgs</build_export_depend>
<exec_depend>actionlib</exec_depend>
<exec_depend>actionlib_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>rospy</exec_depend>

rosmsg output is coming okay

Hi @Pankaj82 ,

You need to add actionlib in your CMakeLists.txt as shown below:

find_package(catkin REQUIRED COMPONENTS
  actionlib
  actionlib_msgs
  rospy
  std_msgs
)

catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES actions_quiz
  CATKIN_DEPENDS actionlib actionlib_msgs rospy std_msgs
#  DEPENDS system_lib
)

You need to import

from actions_quiz.msg import (CustomActionMsgAction,
                              CustomActionMsgActionFeedback,
                              CustomActionMsgActionResult)

instead of using

from actions_quiz.msg import (CustomActionMsgFeedback, 
                              CustomActionMsgResult, 
                              CustomActionMsgAction)

Do these changes and your package will work.

Regards,
Girish

Thanks, I am able to complete my action_quiz. One more question, during my first trial i try to submit my quiz, and i was not able to fix this issue as a result Quiz bot rated me 6, but later I tried to resubmit and quizbot is not accepting my assignment again? what should I do.

Hi @Pankaj82 ,

I think that is some sort of glitch. Try to refresh the page of the course and try to submit again.
This time it should work. If this is your third attempt and still fails, let us know immediately.
Do not exhaust your 5 attempts - otherwise you will not be able to finish the quiz.
Also don’t look into the answer/solution.

Regards,
Girish

Hi Girish, I tried already 3 times, it is not allowing me to submit again, first attempt I got 6 out 10. my course name is ROS in 5 Days

@Pankaj82 You cannot submit anymore because you viewed the solution in your last attempt.
Now you have to do the final assessment, which is the live presentation of the Real Robot Project (mentioned after the ROS Topics - Subscribers and Messages unit).