Created
February 19, 2022 09:52
-
-
Save domhel/4fae70ee87c1ce98131cd672a6f76266 to your computer and use it in GitHub Desktop.
Create and run ROS2 Galactic example package (Ubuntu)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd | |
| apt update && apt upgrade -y && apt install wget | |
| ros2 pkg create --build-type ament_python py_pubsub | |
| wget https://raw.githubusercontent.com/ros2/examples/master/rclpy/topics/minimal_publisher/examples_rclpy_minimal_publisher/publisher_member_function.py -P ~/py_pubsub/py_pubsub | |
| wget https://raw.githubusercontent.com/ros2/examples/master/rclpy/topics/minimal_subscriber/examples_rclpy_minimal_subscriber/subscriber_member_function.py -P ~/py_pubsub/py_pubsub | |
| sed -i '23 i \\t\t"talker = py_pubsub.publisher_member_function:main",\n\t\t"listener = py_pubsub.subscriber_member_function:main"' ~/py_pubsub/setup.py | |
| rosdep install -i --from-path ~ --rosdistro galactic -y | |
| colcon build --packages-select py_pubsub | |
| . install/setup.bash | |
| ros2 run py_pubsub talker & | |
| ros2 run py_pubsub listener |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment