전체 글 210

[ROS2] Tutorial Beginner : Client libraries - Writing a simple service and client(Python)

Writing a simple service and client(Python)Backgroundnode는 service를 이용해 communicate할 때, data를 request하는 node는 client node, respond하는 node를 service node라고 한다.이는 .srv 파일로 정의된다. TasksCreate a packageros2_ws/src directory를 만들어 새로운 package를 만들어보자.ros2 pkg create --build-type ament_python --license Apache-2.0 py_srvcli --dependencies rclpy example_interfaces 필요한 file, folder를 만들었음을 terminal로 확인할 수 있을 ..

ROS2 2024.10.11

[ROS2] Tutorial Beginner : Client libraries - Writing a simple publisher and subscriber(Python)

Writing a simple publisher and subscriber(Python)Backgroundnode를 만들어, 각 topic에 대해 string message를 통해 정보를 주고받는다.이는 간단한 'talker', 'listener' system으로, 하나의 node가 data를 publish하면 다른 node가 data를 subcribe한다. TasksCreate a package# ros2_ws/srcros2 pkg create --build-type ament_python --license Apache-2.0 py_pubsub Write the publisher node# ros2_ws/src/py_pubsub/py_pubsubwget https://raw.githubuserconte..

ROS2 2024.10.11

[ROS2] Tutorial Beginner : Client libraries - Creating a package

Creating a packageBackgroundpackage를 구성함으로써 code 공유, 사용을 쉽게 할 수 있다.ament를 build system으로 사용하고 colcon을 build tool로 사용한다. Python환경에서 package는 아래 5가지가 필요하다.- package.xml : package에 대한 meta information을 가짐- respirce/ : marker file을 가짐- setup.cfg : executable을 찾을 수 있게 해줌- setup.py : package 설치 instruction을 가짐- : package를 찾는데 사용, __init__.py를 가짐my_package/ package.xml resource/my_package ..

ROS2 2024.10.10

[ROS2] Tutorial Beginner : Client libraries - Creating a workspace

Creating a workspaceBackgroundworkspace에는 ROS2 package가 있고, ROS2를 사용하기 전 installation workspace를 source해야 한다.그 외 workspace를 사용하기 위해서 source하는데, 이를 기존 workspace(underlay)에 overlay한다고 한다.underlay에는 overlay에 있는 모든 package의 dependency가 포함되어야 하며, underlay보다 overlay가 우선적이다. Taskssource ROS2 environmentTutorial에서는 ROS2 installation이 underlay이지만 ROS2 installation이 반드시 underlay일 필요는 없다.source /opt/ros/hu..

ROS2 2024.10.10

[ROS2] Tutorial Beginner : Client libraries - Using colcon to build packages

Using colcon to build packagesBackgroundcolcon은 ROS build tool로, CMake 기반 빌드 시스템인 ROS2 패키지의 빌드, 테스트를 한다. Install colconsudo apt install python3-colcon-common-extensions BasicsROS workspace는 특정 구조를 가지는데, 보통 src라는 ROS 패키지의 source code가 있는 subdirectory가 있다.그 후 colcon build를 실행하면 src와 동일 위치에 아래의 directory가 생성된다.- build : intermediate 파일 저장- install : package 설치- log : logging information 저장 Create a..

ROS2 2024.10.09

[ROS2] Tutorial Beginner : CLI tools - Using rqt_console to view logs / Launching nodes / Recording and playing back data

Using rqt_console to view logsBackgroundrqt_console은 GUI툴로 log message를 introspect하는데 사용한다.쉽게 말해서 log message들을 편하게 관리할 수 있게 도와준다. Taskssetupros2 run rqt_console rqt_console  1번째 section은 log message를 보여준다.2번째 section은 message를 필터링할 수 있다.3번째 section은 input을 포함한 message들을 확인할 수 있으며 필터링 또한 가능하다. messages on rqt_consoleros2 run turtlesim turtlesim_noderos2 topic pub -r 1 /turtle1/cmd_vel geometry_m..

ROS2 2024.10.09

[3D] Voxel, Mesh, Point Cloud란?

Voxelvolume + pixel, 3차원 공간에서 정규 격자 단위의 값object의 형태에 따라 voxel이 채워져(1)있거나 비워져(0)있다.1로 채워진 voxel만을 시각화하면 3차원 물체가 표현된다. (like 마인크래프트) Point Cloud좌표계에 속한 점들의 집합 LiDAR 센서로 point cloud를 생성하여 자율 주행에 활용한다.pointcloud를 활용한 classification, segmentation 대표적인 방법이 PointNet이 있다. Mesh다각형(polygon)들의 집합

Computer Vision 2024.10.09

[ROS2] Tutorial Beginner : CLI tools - Understanding actions

Understanding actionsBackgroundaction 또한 ROS2에서 communication하는 방법 중 하나이다.action은 goal, feedback, result 3파트로 구성되어 있다.action은 취소할 수 있다는 것 외에는 service와 유사하다.또한 single response를 return하는 service와 달리 꾸준히 feedback을 한다. action은 client-server model, topic은 publisher-subscriber model이다.action client노드는 action server노드(goal을 승인해줌)로 goal을 보내고 feedback과 result를 받는다.  topicserviceactionmodelpublisher-subsc..

ROS2 2024.10.09

[ROS2] Tutorial Beginner : CLI tools - Understanding parameters

Understanding parametersBackgroundparameter는 노드의 configuration값이다. Taskssetupros2 run turtlesim turtlesim_noderos2 run turtlesim turtle_teleop_key param listros2 param listteleop_turtle, turtlesim 노드 2개를 확인할 수 있는데 모든 노드는 use_sim_time을 가진다. param getparam get을 사용하면 현재 parameter의 type, value를 확인할 수 있다.# ros2 param get ros2 param get /turtlesim background_g param setparam set을 사용하면 parameter의 valu..

ROS2 2024.10.08

[ROS2] Tutorial Beginner : CLI tools - Understanding services

Understanding servicesBackgroundservice는 ROS graph내에서 node간 communication하는 방법 중 하나이다.topic은 publisher-subscribe model, service는 call-and-response model이라는 차이가 있다.topic은 data stream을 subscribe하면서 연속적으로 update가 가능하지만, service는 client가 call할 때만 data를 제공한다. Taskssetupros2 run turtlesim turtlesim_noderos2 run turtlesim turtle_teleop_key service listros2 service list 6개의 parameter service를 볼 수 있는데, 대..

ROS2 2024.10.08