ros2_python24 ros2_msg 토픽 example(executor사용==싱글쓰레드) ROS2 msg sub 부분 code : # =========================================================================================== # !/usr/bin/python # -*- coding: utf-8 -*- import rclpy from rclpy.executors import Executor # noqa: F401 from rclpy.qos import QoSProfile import threading import time from std_msgs.msg import String class SubNodeMakerAgent: """ 멀티 쓰레드 에 멀티 노드 구조 멀티쓰레딩 subscribe 내용을 참조 사이트 https:/.. 2022. 6. 28. ros2 명령어 모음(디버깅할때 유용한거룽) node 관련 ros2 node -h 노드 키거나 끄거나 할때 topic 관련 ros2 topic -h - echo , list , find , pub , info 같은거로 topic 발행 때릴 때 이럴때 씀 ros2 interface show -h - topic의 msg 타입을 검색하거나 할 때 ex) 1 foxy ( 내가만든 ~/.bashrc ) ros2 topic list ros2 topic info /topic_test ros2 interface show std_msgs/msg/String ex) 2 ros2 topic pub --once topic_test std_msgs/msg/String "data : topic testing now!" ex) 3 Type 명은 써도 되고 안써도 됨. ROS.. 2022. 6. 8. ros2_python코드에서 param 데이터 사용법 참고 https://docs.ros.org/en/foxy/Tutorials/Using-Parameters-In-A-Class-Python.html# 이 부분까지 진행중이다. ros2 tutorial 잠깐 멈출거임 ros2 pkg create --build-type ament_python python_parameters --dependencies rclpy 직접 editor로 코드추가 디렉토리 내부에 dev_ws/src/python_parameters/python_parameters라는 새 파일을 만들고 그 python_parameters_node.py안에 다음 코드를 붙여넣습니다. 코드 설명 : my_parameter minimal_param_node 네이밍 -> declare_parameter로 파라미.. 2022. 4. 27. 사용자 정의 ros2 msg, srv파일 구성 https://docs.ros.org/en/foxy/Tutorials/Custom-ROS2-Interfaces.html 참고 참고 부분 보고 tutorial 진행하려고 했는데 문제가 C++,C 하는 거만 있다. ros2 부터는 python 이냐 C++ 이냐에 따라서 package 생성방법(빌드)이 아예 다름 ros2 pkg create --build-type ament_cmake tutorial_interfaces C++ : 이게 ament_cmake 방법으로 패키지 만드는 명령어 ros2 pkg create --build-type ament_python py_srvcli --dependencies rclpy example_interfaces python : 이게 ament_python 방법으로 패키지 .. 2022. 4. 27. ros2_tree구조 기본트리 msg srv action 토픽 아무것도 없는 트리 기본트리 + package + python code(talker , listner) // msg는 기본 msg 사용 더보기 1111@1111:~/ws_1$ tree . ├── build │ ├── COLCON_IGNORE │ └── py_pubsub │ ├── build │ │ └── lib │ │ └── py_pubsub │ │ ├── __init__.py │ │ ├── publisher_member_function.py │ │ └── subscriber_member_function.py │ ├── colcon_build.rc │ ├── colcon_command_prefix_setup_py.sh │ ├── colcon_command_pref.. 2022. 4. 27. ros2_srv 토픽 simple example 참고 https://docs.ros.org/en/foxy/Tutorials/Writing-A-Simple-Py-Service-And-Client.html 패키지 생성 및 코드 data 저장 ~/워크스페이스/src 에 드가서 이거 치삼 srv는 기본예제 weget으로 안받고 패키지 만들고 직접 editor로 작성해서 진행 할거임.! ros2 pkg create --build-type ament_python py_srvcli --dependencies rclpy example_interfaces 저거 세개 수정해줄 거 해주고 (이름 이메일 파일설명 라이센스) 코드 ~/ws_2/src/py_srvcli/py_srvcli$ 안에 들어가서 직접 editor 로 작성 service_member_function.py.. 2022. 4. 27. 이전 1 2 3 4 다음