Topics_Quiz no /odom subscription

Hello everyone,

I tried to complete the “topics_quiz” but it always tells me, that i am not subscibed to the “/odom” topic.
Following subscription is made in the init-method:

self.odom_subscription = self.create_subscription(Odometry, '/odom', self.odom_callback,QoSProfile(depth=10, reliability=ReliabilityPolicy.RELIABLE))

I also get the turn done by 90° in my tests, sending the orientation part to the euler_from_quaternion function

self.euler = euler_from_quaternion(msg.pose.pose.orientation)

Don’t want to copy the whole solution in here. But I always get to know i am not subscribed correctly.
Any suggestions?

Hi @stefanlucke ,

Welcome to this Community!

There are two possibilities here:

  1. Either your code is not working correctly
    (OR)
  2. The GradeBot has some issues.

Let us first try to rule out the first case.
If you know that you have subscribed to /odom correctly, try to print the Odometry message in odom_callback function. If the message prints on the terminal correctly, then your subscription to /odom is correct, otherwise it is wrong. Usually, when the subscription is wrong, it would be due to incorrect QoS setting.

If everything works after checking and verifying all the above steps, then the issue is probably with the GradeBot.
Before we conclude this decision, you can try one last step.

Before submitting to the GradeBot, delete the build, install and log folders inside ros2_ws.
Submit to GradeBot without doing colcon build ....

I hope this fixes your issue. Let me/us know if you still face problems.

Regards,
Girish

1 Like

Hello @stefanlucke ,

I was checking your quiz logs and it seems that the problem is with your node name. The GradeBot expects the node to be named topics_quiz_node (as mentioned in the Specifications of the Quiz), but your node name is topic_quiz_node (note the missing “s”). If you fix this, the problem will probably get solved.

The node-name… crap :smiley:
Poorly I can not check this anymore but thats really a good point.
Thank you for the reply

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.