Sir, Why this error is there ??
AttributeError: type object ‘Empty’ has no attribute ‘_request_class’
Sir, Why this error is there ??
AttributeError: type object ‘Empty’ has no attribute ‘_request_class’
Hi @bhuratsidhu,
You need to check your code, you are trying to use an object of type Empty
(a ROS message I guess) wrongly (perhaps as a request object)
Yes.
You have imported two differrent Empty
objects, so the last one imported wins. You should import (and use) the second one with another name. E.g:
from std_msgs.msg import Empty as EmptyMsg
Other suggestions:
rospy.spin()
, so that all the global variables used with the callback will already exist.rate
object - it’s useless here: Proper use of rospy.Rate or ros::Rate
And what about this error ???
SyntaxError: Non-ASCII character ‘\xe2’ in file /home/user/catkin_ws/src/path_exam/src/distance_motion_service.py on line 4, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
@bayodesegun
Please can i know my mistake for the above error
@bayodesegun
Please can i know why is that error coming if there is nothing on that line 4
Have you tried removing the line? Sometimes you think there’s nothing there but there is if the computer says so .
Yes , I have tried removing the line
Hi, are you able to solve this? There is/was definitely some strange character within the file. If you are not able to solve it yet, I’ll take a look.
No I wasnt able to solve it and that part was not corrected successfully
Please take a look
I have fixed the error.
I was able to fix it just by using the backspace button to remove the line. And when I put it back (using the RETURN key), the problem didn’t return! Weird things like this happen.
Now you have other errors to fix, among others:
time
without importing it.Cheers.