{"id":21007991,"url":"https://github.com/lflxp/ros2study","last_synced_at":"2026-04-25T15:34:23.657Z","repository":{"id":150080899,"uuid":"566252331","full_name":"lflxp/ros2study","owner":"lflxp","description":null,"archived":false,"fork":false,"pushed_at":"2022-11-24T06:38:02.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T10:48:27.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lflxp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-11-15T09:32:38.000Z","updated_at":"2022-11-15T09:33:34.000Z","dependencies_parsed_at":"2023-06-05T03:15:28.280Z","dependency_job_id":null,"html_url":"https://github.com/lflxp/ros2study","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/lflxp%2Fros2study","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Fros2study/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Fros2study/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lflxp%2Fros2study/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lflxp","download_url":"https://codeload.github.com/lflxp/ros2study/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243428436,"owners_count":20289317,"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-19T09:11:04.700Z","updated_at":"2025-12-28T15:26:51.603Z","avatar_url":"https://github.com/lflxp.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hello world\n\n```\nros2 run demo_nodes_py listener\nros2 run demo_nodes_cpp talker\n```\n\n## docker环境一键测试\n\n\u003e docker run --rm -it osrf/ros:foxy-desktop\n\n# py\n\n操作命令\n\n```\n\u003e mkdir -p town_ws/src \u0026\u0026 cd town_ws/src\n\u003e ros2 pkg create village_li --build-type ament_python --dependencies rclpy\n\u003e colcon build\n\u003e ros2 pkg list|grep village_li\n\u003e colcon build --packages-select village_li\n\u003e source install/setup.zsh\n\u003e ros2 run village_li li6\n\u003e ros2 topic list\n\u003e ros2 topic info /sexy_girl_money\n\u003e ros2 topic pub /sexy_girl_money std_msgs/msg/UInt32 \"{data: 20}\" -1\n\u003e ros2 interface show std_msgs/msg/UInt32\n\u003e ros2 interface proto std_msgs/msg/UInt32\n\u003e ros2 interface package sensor_msgs\n\u003e ros2 interface list \n```\n\n# TODO\n\n- https://www.bilibili.com/video/BV1gr4y1Q7j5?p=38\u0026vd_source=d66d1a0aa1f1aea6a6386637292e894f\n\n# cpp wanger扮演订阅渠道/sex_girl topic 然后通过发布渠道/sexy_girl_money进行付钱\n\n操作命令\n\n```\n\u003e ros2 pkg create village_wanger --build-type ament_cmake --dependencies rclcpp\n# 自定义消息\n\u003e ros2 pkg create village_interfaces --build-type ament_cmake\n\u003e colcon build --packages-select village_interfaces\n\u003e ros2 interface package village_interfaces\n\u003e ros2 interface show village_interfaces/msg/Novel\n\u003e ros2 interface proto village_interfaces/msg/Novel\n```\n\n# service\n\n```\nros2 run examples_rclpy_minimal_service service\nros2 service list\nros2 service call /add_two_ints example_interfaces/srv/AddTwoInts \"{a: 5,b: 3}\"\nrqt\n# 查看服务接口类型\nros2 service type /add_two_ints\nros2 interface show example_interfaces/srv/AddTwoInts\nros2 interface proto example_interfaces/srv/AddTwoInts\n# 查看使用某一接口的服务\nros2 service find example_interfaces/srv/AddTwoInts\nros2 interface show village_interfaces/srv/BorrowMoney\nros2 interface show village_interfaces/srv/SellNovel \nros2 interface package village_interfaces\nhttps://www.bilibili.com/video/BV1gr4y1Q7j5/?p=46\u0026spm_id_from=pageDriver\u0026vd_source=d66d1a0aa1f1aea6a6386637292e894f\nRMW_IMPLEMENTATION=rmw_cyclonedds_cpp ros2 run village_li li7\nros2 service list -t\nros2 run village_li li6\nros2 service call /borrow_money village_interfaces/srv/BorrowMoney \"{name: 'fishros', money: 5}\"\nrqt\n```\n\n# c++ service client\n\n```\nros2 pkg create village_zhang --build-type ament_cmake --dependencies rclcpp\ncolcon build\nros2 run village_zhang zhang3_node\nros2 run village_wanger wang2\nros2 run village_li li6\n```\n\n# param 参数\n\n\u003e https://www.bilibili.com/video/BV1gr4y1Q7j5?p=60\u0026spm_id_from=pageDriver\u0026vd_source=d66d1a0aa1f1aea6a6386637292e894f\n\n```\nros2 param list\nros2 param list /li6\nros2 param get /li6 writer_timer_period\nros2 param set /li6 writer_timer_period 1\nros2 topic hz /sexy_girl\ncolcon build --packages-select village_wanger\nrqt\nros2 param get /wang2 novel_price\nros2 param get /wang2 novel_price 1\n```\n\n# Action\n\n一个Action=三个服务+两个话题\n三个服务：\n* 目标传递服务\n* 结果传递服务\n* 取消执行服务\n\n二个话题：\n* 反馈话题（服务发布、客户端订阅）\n* 状态话题（服务端发布，客户端订阅）\n\n```\nros2 action list\nros2 action list -t\nros2 interface show turtlesim/action/RotateAbsolute   \nros2 action info /turtle1/rotate_absolute\nros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute \"{theta: 0}\"\nros2 action send_goal /turtle1/rotate_absolute turtlesim/action/RotateAbsolute \"{theta: 10}\" --feedback # 实时反馈\n```\n\n# launch\n\n```\ncolcon build --packages-select village_li\nsource install/setup.zsh\nros2 launch village_li village.launch.py\ncolcon build --packages-select village_wanger\nros2 param list\n```\n\n# 时光记录仪之rosbag2\n\n```\nros2 bag record -a\nros2 bag record /sexy_girl\nros2 bag -o data.db /sexy_girl\nros2 bag info rosbag2_2022_11_19-20_16_33_0.db3\nros2 bag play rosbag2_2022_11_19-20_16_33_0.db3\nros2 bag play rosbag2_2022_11_19-20_16_33_0.db3 -r 5 # 5倍速播放\nros2 bag play rosbag2_2022_11_19-20_16_33_0.db3 -l # 循环播放\nros2 bag play rosbag2_2022_11_19-20_16_33_0.db3 --topics /sexy_girl # 播放单个话题\nros2 topic echo /sexy_girl\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flflxp%2Fros2study","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flflxp%2Fros2study","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flflxp%2Fros2study/lists"}