Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate / Catch Error #213

Open
Carter90 opened this issue Jun 11, 2021 · 0 comments
Open

Investigate / Catch Error #213

Carter90 opened this issue Jun 11, 2021 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Carter90
Copy link
Contributor

Encountered while searching

import behaviors.scout
scout.searchRandomWalk.main()
[ERROR] [1623389853.498152, 146.106000]: Error processing request: 'NoneType' object has no attribute 'request'
['Traceback (most recent call last):\n', '  File "/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py", line 632, in _handle_request\n    response = convert_return_to_response(self.handler(request), self.response_class)\n', '  File "/SC2/src/scoot/src/Driver.py", line 26, in wrapped_f\n    return func(*args, **kwargs)\n', '  File "/SC2/src/scoot/src/Driver.py", line 148, in _control\n    self.run()  # this will be a blocking call\n', '  File "/SC2/src/scoot/src/Driver.py", line 309, in run\n    if self.Doing.request.y < 0:\n', "AttributeError: 'NoneType' object has no attribute 'request'\n"]
---------------------------------------------------------------------------
ServiceException                          Traceback (most recent call last)
/SC2/src/scoot/src/repl.py in <module>
----> 1 scout.searchRandomWalk.main()

/SC2/src/scoot/src/behaviors/scout/searchRandomWalk.py in main(task)
     83     ignoring = Obstacles.CUBESAT | Obstacles.HOME_FIDUCIAL | Obstacles.HOME_LEG | Obstacles.VISION_VOLATILE
     84 
---> 85     random_walk(num_moves=50)
     86     scoot.brake()
     87     rospy.loginfo("I'm probably lost!")  # @ TODO add a reorient state in the task state meh

/SC2/src/scoot/src/behaviors/scout/searchRandomWalk.py in random_walk(num_moves)
     47             if rospy.is_shutdown():
     48                 sys.exit(-1)
---> 49             wander()
     50     except VolatileException:
     51         rospy.logwarn("I found a volatile! " + scoot.VOL_TYPES[scoot.control_data])

/SC2/src/scoot/src/behaviors/scout/searchRandomWalk.py in wander()
     28     try:
     29         rospy.loginfo("Wandering...")
---> 30         scoot.drive(random.gauss(4, 1), ignore=ignoring)
     31         scoot.turn(random.gauss(-math.pi / 4, math.pi / 4), ignore=ignoring)
     32 

/SC2/src/scoot/src/Scoot.py in drive(self, distance, **kwargs)
    485             x=distance,
    486         )
--> 487         return self.__drive(req, **kwargs)
    488 
    489     def translate(self, x, y, **kwargs):

/SC2/src/scoot/src/Scoot.py in wrapped_f(*args, **kwargs)
     86         def wrapped_f(*args, **kwargs):
     87             with self.lock:
---> 88                 return func(*args, **kwargs)
     89 
     90         return wrapped_f

/SC2/src/scoot/src/Scoot.py in __drive(self, request, **kwargs)
    447             request.angular = kwargs['angular']
    448 
--> 449         move_result = self.control([request]).result
    450         value = move_result.result
    451         obstacle = move_result.obstacle

/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py in __call__(self, *args, **kwds)
    440         message. This is usually a type error with one of the fields.
    441         """
--> 442         return self.call(*args, **kwds)
    443     
    444     def _get_service_uri(self, request):

/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py in call(self, *args, **kwds)
    520 
    521         try:
--> 522             responses = transport.receive_once()
    523             if len(responses) == 0:
    524                 raise ServiceException("service [%s] returned no response"%self.resolved_name)

/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_base.py in receive_once(self)
    733             while not msg_queue and not self.done and not is_shutdown():
    734                 if b.tell() >= 4:
--> 735                     p.read_messages(b, msg_queue, sock) 
    736                 if not msg_queue:
    737                     self.stat_bytes += recv_buff(sock, b, p.buff_size)

/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py in read_messages(self, b, msg_queue, sock)
    358         @type  sock: socket.socket
    359         """
--> 360         self._read_ok_byte(b, sock)
    361         rospy.msg.deserialize_messages(b, msg_queue, self.recv_data_class, queue_size=self.queue_size, max_msgs=1, start=1) #rospy.msg
    362         #deserialize_messages only resets the buffer to the start

/opt/ros/noetic/lib/python3/dist-packages/rospy/impl/tcpros_service.py in _read_ok_byte(self, b, sock)
    341             b.seek(0)
    342             b.truncate(0)
--> 343             raise ServiceException("service [%s] responded with an error: %s"%(self.resolved_name, str))
    344         else:
    345             # success, set seek point to start of message

ServiceException: service [/small_scout_1/control] responded with an error: b"error processing request: 'NoneType' object has no attribute 'request'"
@Carter90 Carter90 added bug Something isn't working help wanted Extra attention is needed labels Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant