{"id":19532387,"url":"https://github.com/esimkowitz/sphero-rvr-ros2","last_synced_at":"2025-04-26T13:33:00.671Z","repository":{"id":62282584,"uuid":"544296452","full_name":"esimkowitz/sphero-rvr-ros2","owner":"esimkowitz","description":"Containerized ROS2 Node for Sphero RVR","archived":false,"fork":false,"pushed_at":"2024-05-28T17:12:05.000Z","size":122,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-29T08:21:03.231Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esimkowitz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-02T05:43:18.000Z","updated_at":"2024-05-28T17:12:09.000Z","dependencies_parsed_at":"2024-05-28T19:46:35.292Z","dependency_job_id":"d95f9120-1b1a-4a3f-9628-6fc54e38cec2","html_url":"https://github.com/esimkowitz/sphero-rvr-ros2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimkowitz%2Fsphero-rvr-ros2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimkowitz%2Fsphero-rvr-ros2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimkowitz%2Fsphero-rvr-ros2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esimkowitz%2Fsphero-rvr-ros2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esimkowitz","download_url":"https://codeload.github.com/esimkowitz/sphero-rvr-ros2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224036376,"owners_count":17245035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T01:50:42.741Z","updated_at":"2024-11-11T01:50:44.370Z","avatar_url":"https://github.com/esimkowitz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Containerized RO2 Node for Sphero RVR\n\nPyhton 3 [ROS2](https://docs.ros.org/en/humble/#) node for interacting with [Sphero RVR](https://www.sphero.com/rvr).\n\nRuns in Docker for easy integration and streamlined dependency management.\n\n[![Docker Image CI](https://github.com/esimkowitz/sphero-rvr-ros2/actions/workflows/build-docker-image.yml/badge.svg)](https://github.com/esimkowitz/sphero-rvr-ros2/actions/workflows/build-docker-image.yml)\n\n## Current Functionality\n\nThe rvr_node node supports the following commands:\n\n- Start the RVR rolling in a given heading using the `rvr_start_roll` topic.\n- Stop the RVR using the `rvr_stop_roll` topic.\n- Adjust the RVR heading using the `change_heading` action.\n- Ability to publish to the ROS2 topics anywhere on the network (provided you are on the same domain id as the RVR)\n\nThe robot_control node hosts a Flask website for sending commands remotely to the RVR. [See below](#control-using-the-robot_control-webpage) for more information.\n\nThe whole setup is fairly stable now thanks to improvements I've made in the executor loop, as well as mocked interfaces I've added to help when testing off of the Raspberry Pi.\n\n## Future work\n\nIn the future, I plan to add the following:\n\n- Sensor streaming to topics\n- URDF specifications for better positioning, drive data, and simulations\n- Potentially more advanced commands from the SDK like drive-to-x, etc.\n\n### Run via Docker Compose\n\nThe easiest way to run the node is in Docker Compose using the script provided here: [run_docker_compose.sh](scripts/helper/run_docker_compose.sh).\n\nThe script specifies two optional flags:\n\n- `-b`: Specifies whether to build the container image from source. By default, the script will use the version from Docker Hub.\n- `-m`: Specifies whether to mock the RVR interface, which is useful when testing functionality off of the Raspberry Pi, such as on your development computer. By default, the interface is not mocked.\n\nand one optional parameter:\n- `-r`: Specifies which ROS2 Domain ID you want your RVR to be registered on. Default is 0.\n\nThe [docker-compose.yml](docker-compose.yml) file has the details on the run configuration, it functions the same as the command [below](#running-directly-via-docker) except without an interactive shell.\n\n## Running directly via Docker\n\nIf you need to debug something directly on the container, you can log in using interactive mode using the following command:\n\n```Bash\ndocker run -it --rm -v /dev/ttyS0:/dev/ttyS0 -e MOCK_RVR=false --privileged esimkowitz/sphero-rvr-ros2:latest -- bash\n```\n\nI have noticed that the exec shell will exit whenever there is a nonzero exit code for a command so I've gotten into the habit of starting a sh session and then another bash session within that, that way if bash exits I can quickly restart it. Otherwise, the container will close on any nonzero error code.\n\n## Control using the robot_control webpage\n\nBy default, the docker-compose configuration will also launch a Flask app that can be used to control the robot remotely, mainly to demonstrate the performance of the ROS driver. This solution has been adapted from a previous robot project I was working on, [esimkowitz/RobotControl](https://github.com/esimkowitz/RobotControl).\n\nTo load the page, visit `http://\u003crobot-ip\u003e:8080` in your web browser. There is an on-screen joystick similar to the old Sphero app that lets you command both the speed and the heading. There is also support for the WASD and arrow keys.\n\nButton functionality:\n\n- Up/W: roll forward at a set speed\n- Down/S: roll backward at a set speed\n- Right/D: turn to the right by 10 degrees\n- Left/A: turn to the left by 10 degrees\n\n## Publish commands to node via ROS CLI\n\nYou can publish commands by opening a Bash shell on the container running in Docker Compose.\n\nTo start the Bash shell, run the following command:\n\n```Bash\ndocker compose exec rvr_server bash\n```\n\nThen, you can use the commands in the [test_commands.sh](scripts/helper/test_commands.sh) file to publish commands to the running node.\n\n## Credit\n\nThank you [@DomnikN](https://github.com/DominikN) for your very well documented project [DominikN/ros2_docker_examples](https://github.com/DominikN/ros2_docker_examples).\n\nThank you [@gumstix/Altium](https://github.com/gumstix) for your [RVR ROS2 Node demo](https://github.com/gumstix/PKG900000001506/tree/master/demo/Sphero%20RVR/ros2%20node).\n\n## License\n\nMIT \u0026copy; Evan Simkowitz, 2023, see [LICENSE](LICENSE.md) for additional licenses.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimkowitz%2Fsphero-rvr-ros2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesimkowitz%2Fsphero-rvr-ros2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesimkowitz%2Fsphero-rvr-ros2/lists"}