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

Update subscribers.py #562

Closed
wants to merge 1 commit into from
Closed

Update subscribers.py #562

wants to merge 1 commit into from

Conversation

hangst
Copy link

@hangst hangst commented Mar 3, 2021

.values() should return an iterable. Wrapping with another iterable (list) leads to this error.

[ERROR] Exception calling subscribe callback: 'dict_values' object is not callable

`.values()` should return an iterable. Wrapping with another iterable (list) leads to this error.

[ERROR] Exception calling subscribe callback: 'dict_values' object is not callable
@jihoonl jihoonl added the ros2 ros2 label Jul 29, 2021
@jtbandes
Copy link
Member

Hi, can you share some more information and reproduction steps for the bug that's being fixed here? I've added a smoke test in #585 and it would be great if you could update this PR to ensure this code is covered by the tests.

@hangst
Copy link
Author

hangst commented Aug 19, 2021

With rosbridge_websocket.py (ros2 branch) running, this script should trigger 'dict_values' object is not callable error.

<script>
const payload = JSON.stringify({
    "op": "subscribe",
    "topic": "/rosout",
})
new WebSocket("ws://localhost:9090").addEventListener("open", function () {
    this.send(payload) // 1st subscription request
    this.send(payload) // 2nd subscription request, triggers error
})
</script>

This error happens when a WebSocket client makes multiple subscription requests on the same topic.

@hangst
Copy link
Author

hangst commented Aug 20, 2021

@jtbandes FYI this is the Dockerfile I used to build rosbridge_suite from source.

FROM ros:foxy
WORKDIR /root
RUN git clone --depth 1 --branch ros2 https://github.com/RobotWebTools/rosbridge_suite
RUN apt-get update
RUN rosdep update
RUN rosdep install --default-yes --ignore-src --from-path .
RUN . /opt/ros/foxy/setup.sh && colcon build
CMD ["bash", "-c", ". install/setup.bash && ros2 run rosbridge_server rosbridge_websocket.py"]

rosbridge_websocket.py is executed with the following command.

docker build . --tag rosbridge_suite
docker run -it --net=host rosbridge_suite

@github-actions
Copy link

This PR has been marked as stale because it has had no activity in the past 90 days. Please remove the stale label or add a comment to keep it open. Thank you for your contribution.

@github-actions github-actions bot added the stale label Nov 19, 2021
@jtbandes jtbandes removed the stale label Dec 2, 2021
@jtbandes
Copy link
Member

jtbandes commented Dec 2, 2021

Thanks for the contribution. I am going to close this PR and work from #671 instead, which covers the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ros2 ros2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants