소스 정보
- 저장소
- harunkurtdev/ros2-claude-code-template
- 최근 소스 활동
- 2026년 2월 8일 22:47
- 감지된 SKILL.md 언어
- 영어
- 스타
- 213
- 포크
- 32
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/harunkurtdev/ros2-claude-code-template --skill ros2-transforms-tf2명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
Author a new asset for this .claude/ template — a rule, skill, slash command, or sub-agent — following the project's conventions and wiring it into the CLAUDE.md / README.md indexes. Trigger when the user wants to add or extend a command, skill, agent, or rule (make the template itself extensible).
Bootstrap a complete ROS 2 colcon workspace from scratch — directory layout, .gitignore, top-level README, this .claude/ config, an interfaces package and a first Clean Architecture package, and a bringup package. Trigger when the user asks to create a new workspace / start a new ROS 2 project from zero.
Scaffold a Behavior Tree leaf node — plain BehaviorTree.CPP (SyncActionNode / StatefulActionNode / ConditionNode) or a BehaviorTree.ROS2 wrapper (RosActionNode / RosServiceNode / RosTopicPubNode / RosTopicSubNode) — with ports, factory/plugin registration, and XML v4 usage. Trigger when the user asks to write a behavior-tree node (not Nav 2-specific).
SOC 직업 분류 기준
SKILL.md 표시 중
| name | ROS2 Transforms (TF2) |
| description | ROS2 TF2 and Transform management with Clean Architecture (Python & C++) |
This skill demonstrates how to use the ROS2 TF2 (Transform Library) while adhering to Clean Architecture principles. The Domain layer should be protected from direct TF2 dependencies by using Repository or Service patterns.
The domain layer should not depend on TF2 or geometry_msgs.
# domain/entities/pose.py
from dataclasses import dataclass
@dataclass
class Pose:
position: tuple # (x, y, z)
orientation: tuple # (x, y, z, w)
frame_id: str
timestamp: float
// domain/entities/pose.hpp
#pragma once
#include <string>
namespace domain::entities {
struct Point3D { double x, y, z; };
struct Quaternion { double x, y, z, w; };
struct Pose {
Point3D position;
Quaternion orientation;
std::string frame_id;
double timestamp;
};
} // namespace
TF2 implementation resides here.
See previous Python example.
// infrastructure/ros2/services/tf_service.hpp
#pragma once
#include <rclcpp/rclcpp.hpp>
#include <tf2_ros/buffer.h>
#include <tf2_ros/transform_listener.h>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include "domain/interfaces/transform_service.hpp"
namespace infrastructure::ros2::services {
class TFService : public domain::interfaces::ITransformService {
public:
explicit TFService(rclcpp::Node::SharedPtr node);
std::optional<domain::entities::Pose> get_transform(
const std::string& target_frame,
const std::string& source_frame) override;
private:
rclcpp::Node::SharedPtr node_;
std::shared_ptr<tf2_ros::Buffer> tf_buffer_;
std::shared_ptr<tf2_ros::TransformListener> tf_listener_;
};
} // namespace
// infrastructure/ros2/services/tf_service.cpp
#include "infrastructure/ros2/services/tf_service.hpp"
namespace infrastructure::ros2::services {
TFService::TFService(rclcpp::Node::SharedPtr node) : node_(node) {
tf_buffer_ = std::make_shared<tf2_ros::Buffer>(node_->get_clock());
tf_listener_ = std::make_shared<tf2_ros::TransformListener>(*tf_buffer_);
}
{
{
geometry_msgs::msg::TransformStamped t = tf_buffer_->(
target_frame, source_frame, tf2::TimePointZero);
domain::entities::Pose{
{t.transform.translation.x, t.transform.translation.y, t.transform.translation.z},
{t.transform.rotation.x, t.transform.rotation.y, t.transform.rotation.z, t.transform.rotation.w},
t.header.frame_id,
rclcpp::(t.header.stamp).()
};
} ( tf2::TransformException & ex) {
(node_->(), ,
source_frame.(), target_frame.(), ex.());
std::;
}
}
}
// infrastructure/ros2/helpers/tf_publisher.hpp
#include <tf2_ros/static_transform_broadcaster.h>
class TFPublisher {
public:
TFPublisher(rclcpp::Node::SharedPtr node) : node_(node) {
static_broadcaster_ = std::make_shared<tf2_ros::StaticTransformBroadcaster>(node);
}
void publish_static(const std::string& parent, const std::string& child,
const std::array<double, 3>& trans,
const std::array<double, 4>& rot) {
geometry_msgs::msg::TransformStamped t;
t.header.stamp = node_->get_clock()->now();
t.header.frame_id = parent;
t.child_frame_id = child;
t.transform.translation.x = trans[0];
// ...
static_broadcaster_->sendTransform(t);
}
private:
rclcpp::Node::SharedPtr node_;
std::shared_ptr<tf2_ros::StaticTransformBroadcaster> static_broadcaster_;
};
tf2_ros.tf2::TransformException.Time(0)) for data synchronization when possible.