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

Python3 threading Semaphore changes #163

Closed
Carter90 opened this issue Mar 2, 2021 · 1 comment · Fixed by #180
Closed

Python3 threading Semaphore changes #163

Carter90 opened this issue Mar 2, 2021 · 1 comment · Fixed by #180
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@Carter90
Copy link
Contributor

Carter90 commented Mar 2, 2021

While the scoot is technically able to drive I'm concerned

[ERROR] [1614663158.085422, 216.011000]: Error processing request: 'NoneType' object has no attribute 'acquire'
['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 "/home/carter/SC2/src/scoot/src/Driver.py", line 151, in _control\n    while not t.sema.acquire(blocking=False):\n', "AttributeError: 'NoneType' object has no attribute 'acquire'\n"]
@Carter90 Carter90 added bug Something isn't working invalid This doesn't seem right labels Mar 2, 2021
@abbypribis
Copy link
Contributor

abbypribis commented Mar 6, 2021

Commented out in Driver.py:

while not t.sema.acquire(blocking=False):
    rospy.sleep(sleep_wait)
    sleep_turns -= 1
    if sleep_turns == 0:
    # Ugh. Is this safe?
    with package_lock:
         self._stop_now(MoveResult.TIMEOUT)

sema was always set of None, so it couldn't "acquire" anything.

Might cause issues when handling multiple drive commands - keep in mind.

@Carter90 Carter90 self-assigned this Apr 1, 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 invalid This doesn't seem right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants