[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CX18QWM4J8W8MMSKBBSV25":3,"skill-same:01M6CX18QWM4J8W8MMSKBBSV25":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":24,"linkOnly":25,"markdownContent":26,"markdownBody":27,"frontMatter":28,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":37,"install":38,"resources":51},"01M6CX18QWM4J8W8MMSKBBSV25","robotics",null,"Robotics fundamentals including kinematics, dynamics, motion planning, perception, control, and human-robot interaction","ffsshhttiikk\u002Fopencode-agents-skills","ffsshhttiikk","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F226346827?v=4","01M6CWD9RR3Y7VRQX3MXYC8FYH","01M6CWD9WVPYAZW0J82G1VKGHY",3,"MIT","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fengineering\u002Frobotics\u002FSKILL.md",[],[5,18,19,20,21,22,23],"planning","engineering","opencode","motion","human","robot","2026-11-10 10:12:30",false,"---\nname: robotics\ndescription: Robotics fundamentals including kinematics, dynamics, motion planning, perception, control, and human-robot interaction\nlicense: MIT\ncompatibility: opencode\nmetadata:\n  audience: engineers\n  category: engineering\n---\n\n## What I do\n- Model robot kinematics and dynamics\n- Design motion planning algorithms\n- Implement perception and computer vision systems\n- Develop robot control systems\n- Design end-effectors and grippers\n- Integrate sensors and actuators\n- Plan human-robot interaction interfaces\n- Simulate and test robotic systems\n\n## When to use me\nWhen designing robotic systems, implementing kinematics, developing motion planning algorithms, or integrating perception systems for automation.\n\n## Core Concepts\n- Forward and inverse kinematics\n- Robot dynamics (Lagrangian, Newton-Euler)\n- Trajectory planning and path optimization\n- Sensor integration (LiDAR, cameras, IMUs)\n- Computer vision for robotics\n- Motion control (PID, MPC, adaptive control)\n- Force\u002Ftorque control and impedance control\n- Grip design and grasping\n- ROS\u002FROS2 development\n- Swarm robotics and multi-agent systems\n\n## Code Examples\n\n### Forward Kinematics\n```python\nimport numpy as np\nfrom dataclasses import dataclass\nfrom typing import List, Tuple\nimport math\n\n@dataclass\nclass DHParameter:\n    a: float  # link length\n    alpha: float  # link twist\n    d: float  # link offset\n    theta: float  # joint angle\n\ndef transformation_matrix(\n    a: float,\n    alpha: float,\n    d: float,\n    theta: float\n) -> np.ndarray:\n    \"\"\"Create DH transformation matrix.\"\"\"\n    c = math.cos(theta)\n    s = math.sin(theta)\n    ca = math.cos(alpha)\n    sa = math.sin(alpha)\n    \n    return np.array([\n        [c, -s * ca,  s * sa, a * c],\n        [s,  c * ca, -c * sa, a * s],\n        [0,  sa,      ca,     d],\n        [0,  0,       0,      1]\n    ])\n\ndef forward_kinematics(\n    dh_params: List[DHParameter]\n) -> np.ndarray:\n    \"\"\"Calculate forward kinematics for robot arm.\"\"\"\n    T = np.eye(4)\n    for params in dh_params:\n        T = T @ transformation_matrix(\n            params.a, params.alpha, params.d, params.theta\n        )\n    return T\n\n# Example: 3-DOF planar arm\ndh_3dof = [\n    DHParameter(a=0.5, alpha=0, d=0, theta=0.3),\n    DHParameter(a=0.4, alpha=0, d=0, theta=0.5),\n    DHParameter(a=0.3, alpha=0, d=0, theta=-0.2)\n]\nT_ee = forward_kinematics(dh_3dof)\nprint(f\"End effector position: [{T_ee[0,3]:.3f}, {T_ee[1,3]:.3f}, {T_ee[2,3]:.3f}]\")\n```\n\n### Inverse Kinematics\n```python\ndef planar_ik(\n    x: float,\n    y: float,\n    L1: float,\n    L2: float\n) -> Tuple[float, float, float, float]:\n    \"\"\"Analytical inverse kinematics for 2-link planar arm.\"\"\"\n    D = (x**2 + y**2 - L1**2 - L2**2) \u002F (2 * L1 * L2)\n    if abs(D) > 1:\n        return None\n    \n    theta2 = math.atan2(math.sqrt(1 - D**2), D)\n    theta1 = math.atan2(y, x) - math.atan2(\n        L2 * math.sin(theta2), L1 + L2 * math.cos(theta2)\n    )\n    return theta1, theta2, -theta2, theta1\n\ndef jacobian_ik(\n    target_pose: np.ndarray,\n    current_joints: np.ndarray,\n    T_base: np.ndarray,\n    link_lengths: List[float],\n    iterations: int = 100,\n    alpha: float = 0.1\n) -> np.ndarray:\n    \"\"\"Iterative inverse kinematics using Jacobian.\"\"\"\n    joints = current_joints.copy()\n    for _ in range(iterations):\n        T_current = forward_kinematics([\n            DHParameter(a=link_lengths[i], alpha=0, d=0, theta=joints[i])\n            for i in range(len(joints))\n        ])\n        \n        error = np.zeros(6)\n        error[0:3] = target_pose[0:3, 3] - T_current[0:3, 3]\n        \n        if np.linalg.norm(error) \u003C 1e-4:\n            break\n        \n        J = numerical_jacobian(joints, link_lengths)\n        try:\n            joints += alpha * np.linalg.lstsq(J, error, rcond=None)[0]\n        except:\n            break\n    return joints\n\n# Example: IK for point (1.0, 0.5)\nsolution = planar_ik(1.0, 0.5, 0.8, 0.6)\nif solution:\n    print(f\"Theta1: {solution[0]:.3f} rad ({math.degrees(solution[0]):.1f}°)\")\n    print(f\"Theta2: {solution[1]:.3f} rad ({math.degrees(solution[1]):.1f}°)\")\n```\n\n### Trajectory Planning\n```python\ndef cubic_polynomial(\n    t: float,\n    t0: float,\n    tf: float,\n    p0: float,\n    pf: float,\n    v0: float = 0,\n    vf: float = 0\n) -> Tuple[float, float]:\n    \"\"\"Generate cubic polynomial trajectory.\"\"\"\n    T = tf - t0\n    a0 = p0\n    a1 = v0\n    a2 = 3 * (pf - p0) \u002F T**2 - 2 * v0 \u002F T - vf \u002F T\n    a3 = -2 * (pf - p0) \u002F T**3 + (v0 + vf) \u002F T**2\n    \n    if t \u003C t0:\n        tau = 0\n    elif t > tf:\n        tau = T\n    else:\n        tau = t - t0\n    \n    p = a0 + a1 * tau + a2 * tau**2 + a3 * tau**3\n    v = a1 + 2 * a2 * tau + 3 * a3 * tau**2\n    return p, v\n\ndef quintic_polynomial(\n    t: float,\n    t0: float, tf: float,\n    p0: float, pf: float,\n    v0: float = 0, vf: float = 0,\n    a0: float = 0, af: float = 0\n) -> Tuple[float, float, float]:\n    \"\"\"Generate quintic polynomial with acceleration control.\"\"\"\n    T = tf - t0\n    a0 = p0\n    a1 = v0\n    a2 = a0 \u002F 2\n    a3 = (20 * (pf - p0) - (8 * vf + 12 * v0) - (3 * af - a0) * T) \u002F (2 * T**3)\n    a4 = (30 * (p0 - pf) + (14 * vf + 16 * v0) + (af - 2 * a0) * T) \u002F (2 * T**4)\n    a5 = (12 * (pf - p0) - 6 * (vf + v0) - (af - a0) * T) \u002F (2 * T**5)\n    \n    if t \u003C t0:\n        return p0, v0, a0\n    elif t > tf:\n        return pf, vf, af\n    \n    tau = t - t0\n    p = a0 + a1 * tau + a2 * tau**2 + a3 * tau**3 + a4 * tau**4 + a5 * tau**5\n    v = a1 + 2 * a2 * tau + 3 * a3 * tau**2 + 4 * a4 * tau**3 + 5 * a5 * tau**4\n    a = 2 * a2 + 6 * a3 * tau + 12 * a4 * tau**2 + 20 * a5 * tau**3\n    return p, v, a\n\ndef rrt_star(\n    start: Tuple[float, float],\n    goal: Tuple[float, float],\n    obstacles: List[Tuple[float, float, float]],\n    bounds: Tuple[float, float],\n    max_iter: int = 500,\n    step_size: float = 0.5\n) -> List[Tuple[float, float]]:\n    \"\"\"RRT* path planning algorithm.\"\"\"\n    from scipy.spatial.distance import cdist\n    \n    nodes = [start]\n    parents = [None]\n    costs = [0]\n    \n    for _ in range(max_iter):\n        if np.random.random() \u003C 0.1:\n            rand = goal\n        else:\n            rand = (np.random.uniform(bounds[0], bounds[1]),\n                   np.random.uniform(bounds[0], bounds[1]))\n        \n        nearest_idx = min(range(len(nodes)),\n                         key=lambda i: np.linalg.norm(\n                             np.array(nodes[i]) - np.array(rand)))\n        \n        direction = np.array(rand) - np.array(nodes[nearest_idx])\n        dist = np.linalg.norm(direction)\n        if dist > step_size:\n            direction = direction \u002F dist * step_size\n        \n        new_node = tuple(np.array(nodes[nearest_idx]) + direction)\n        \n        if not collision_check(new_node, obstacles):\n            continue\n        \n        # Find near neighbors\n        near_idx = [i for i in range(len(nodes))\n                   if np.linalg.norm(np.array(nodes[i]) - np.array(new_node)) \u003C step_size * 3]\n        \n        # Connect to best parent\n        best_idx = nearest_idx\n        best_cost = costs[nearest_idx] + step_size\n        for idx in near_idx:\n            cost = costs[idx] + np.linalg.norm(\n                np.array(nodes[idx]) - np.array(new_node))\n            if cost \u003C best_cost:\n                best_cost = cost\n                best_idx = idx\n        \n        nodes.append(new_node)\n        parents.append(best_idx)\n        costs.append(best_cost)\n        \n        # Rewire\n        for idx in near_idx:\n            if idx == best_idx:\n                continue\n            new_cost = costs[best_idx] + np.linalg.norm(\n                np.array(new_node) - np.array(nodes[idx]))\n            if new_cost \u003C costs[idx]:\n                costs[idx] = new_cost\n                parents[idx] = best_idx\n    \n    # Extract path\n    path = [goal]\n    current = goal\n    while current != start:\n        idx = nodes.index(current)\n        current = nodes[parents[idx]]\n        path.append(current)\n    path.reverse()\n    return path\n\n# Example: Trajectory generation\ntrajectory = []\nfor t in np.linspace(0, 2, 100):\n    p, v = cubic_polynomial(t, 0, 2, 0, 1)\n    trajectory.append((p, v))\nprint(f\"Trajectory points: {len(trajectory)}\")\n```\n\n### Computer Vision for Robotics\n```python\ndef camera_calibration(\n    image_points: np.ndarray,\n    object_points: np.ndarray\n) -> Tuple[np.ndarray, np.ndarray]:\n    \"\"\"Perform camera calibration using Zhang's method.\"\"\"\n    return cv.calibrateCamera(object_points, image_points, (640, 480))\n\ndef aruco_detection(\n    image: np.ndarray,\n    marker_dict: cv.aruco.Dictionary_get(cv.aruco.DICT_6X6_250)\n) -> List[dict]:\n    \"\"\"Detect ArUco markers for robot localization.\"\"\"\n    corners, ids, rejected = cv.aruco.detectMarkers(\n        image, marker_dict)\n    return [{\"id\": i[0] if i is not None else None, \n             \"corners\": c} for i, c in zip(ids, corners)]\n\ndef depth_from_stereo(\n    disparity: np.ndarray,\n    focal_length: float,\n    baseline: float\n) -> np.ndarray:\n    \"\"\"Calculate depth from stereo disparity.\"\"\"\n    depth = focal_length * baseline \u002F (disparity + 1e-6)\n    depth[depth \u003C 0] = 0\n    return depth\n\ndef point_cloud_from_depth(\n    depth: np.ndarray,\n    fx: float,\n    fy: float,\n    cx: float,\n    cy: float\n) -> np.ndarray:\n    \"\"\"Generate point cloud from depth image.\"\"\"\n    x, y = np.meshgrid(np.arange(depth.shape[1]), np.arange(depth.shape[0]))\n    X = (x - cx) * depth \u002F fx\n    Y = (y - cy) * depth \u002F fy\n    Z = depth\n    return np.stack([X, Y, Z], axis=-1)\n```\n\n### Robot Control\n```python\ndef jacobian_derivative(\n    q: np.ndarray,\n    dq: np.ndarray,\n    link_lengths: List[float]\n) -> np.ndarray:\n    \"\"\"Calculate time derivative of Jacobian.\"\"\"\n    n = len(q)\n    J = np.zeros((6, n))\n    for i in range(n):\n        J[0, i] = -sum(link_lengths[k] * math.sin(sum(q[:k+1])) \n                       for k in range(i, n)) if i \u003C n - 1 else 0\n        J[1, i] = sum(link_lengths[k] * math.cos(sum(q[:k+1])) \n                       for k in range(i, n)) if i \u003C n - 1 else link_lengths[-1]\n    return J\n\ndef computed_torque_control(\n    q_des: np.ndarray,\n    dq_des: np.ndarray,\n    ddq_des: np.ndarray,\n    q: np.ndarray,\n    dq: np.ndarray,\n    M: np.ndarray,\n    C: np.ndarray,\n    G: np.ndarray,\n    Kp: np.ndarray,\n    Kd: np.ndarray\n) -> np.ndarray:\n    \"\"\"Computed torque control with PD feedback.\"\"\"\n    e = q_des - q\n    de = dq_des - dq\n    tau_feedforward = M @ ddq_des + C @ dq_des + G\n    tau_feedback = Kp @ e + Kd @ de\n    return tau_feedforward + tau_feedback\n\ndef impedance_control(\n    x: np.ndarray,\n    dx: np.ndarray,\n    xd: np.ndarray,\n    dxd: np.ndarray,\n    M_d: np.ndarray,\n    B_d: np.ndarray,\n    K_d: np.ndarray,\n    F_ext: np.ndarray\n) -> np.ndarray:\n    \"\"\"Impedance control for force regulation.\"\"\"\n    e = x - xd\n    de = dx - dxd\n    F_desired = M_d @ (-ddx_des if False else np.zeros(3)) + B_d @ de + K_d @ e\n    return F_desired + F_ext\n\n# Example: PD controller for joint control\nKp = 100 * np.eye(6)\nKd = 20 * np.eye(6)\nq_des = np.array([0.5, 0.3, -0.2, 0, 0, 0])\ndq_des = np.zeros(6)\nddq_des = np.zeros(6)\nq_current = np.array([0.4, 0.25, -0.15, 0, 0, 0])\ndq_current = np.array([0.1, 0.05, -0.03, 0, 0, 0])\n```\n\n## Best Practices\n- Use simulation (Gazebo, Webots) before hardware deployment\n- Implement safety stops and limit switches in hardware\n- Consider workspace constraints and singularities in motion planning\n- Use proper coordinate frames (world, base, tool, camera)\n- Account for calibration errors and thermal drift\n- Implement smooth trajectory generation with velocity\u002Facceleration limits\n- Use redundancy resolution for obstacle avoidance\n- Consider sensor fusion for improved state estimation\n- Implement graceful degradation for sensor failures\n- Document robot configuration and calibration parameters\n","## What I do\n- Model robot kinematics and dynamics\n- Design motion planning algorithms\n- Implement perception and computer vision systems\n- Develop robot control systems\n- Design end-effectors and grippers\n- Integrate sensors and actuators\n- Plan human-robot interaction interfaces\n- Simulate and test robotic systems\n\n## When to use me\nWhen designing robotic systems, implementing kinematics, developing motion planning algorithms, or integrating perception systems for automation.\n\n## Core Concepts\n- Forward and inverse kinematics\n- Robot dynamics (Lagrangian, Newton-Euler)\n- Trajectory planning and path optimization\n- Sensor integration (LiDAR, cameras, IMUs)\n- Computer vision for robotics\n- Motion control (PID, MPC, adaptive control)\n- Force\u002Ftorque control and impedance control\n- Grip design and grasping\n- ROS\u002FROS2 development\n- Swarm robotics and multi-agent systems\n\n## Code Examples\n\n### Forward Kinematics\n```python\nimport numpy as np\nfrom dataclasses import dataclass\nfrom typing import List, Tuple\nimport math\n\n@dataclass\nclass DHParameter:\n    a: float  # link length\n    alpha: float  # link twist\n    d: float  # link offset\n    theta: float  # joint angle\n\ndef transformation_matrix(\n    a: float,\n    alpha: float,\n    d: float,\n    theta: float\n) -> np.ndarray:\n    \"\"\"Create DH transformation matrix.\"\"\"\n    c = math.cos(theta)\n    s = math.sin(theta)\n    ca = math.cos(alpha)\n    sa = math.sin(alpha)\n    \n    return np.array([\n        [c, -s * ca,  s * sa, a * c],\n        [s,  c * ca, -c * sa, a * s],\n        [0,  sa,      ca,     d],\n        [0,  0,       0,      1]\n    ])\n\ndef forward_kinematics(\n    dh_params: List[DHParameter]\n) -> np.ndarray:\n    \"\"\"Calculate forward kinematics for robot arm.\"\"\"\n    T = np.eye(4)\n    for params in dh_params:\n        T = T @ transformation_matrix(\n            params.a, params.alpha, params.d, params.theta\n        )\n    return T\n\n# Example: 3-DOF planar arm\ndh_3dof = [\n    DHParameter(a=0.5, alpha=0, d=0, theta=0.3),\n    DHParameter(a=0.4, alpha=0, d=0, theta=0.5),\n    DHParameter(a=0.3, alpha=0, d=0, theta=-0.2)\n]\nT_ee = forward_kinematics(dh_3dof)\nprint(f\"End effector position: [{T_ee[0,3]:.3f}, {T_ee[1,3]:.3f}, {T_ee[2,3]:.3f}]\")\n```\n\n### Inverse Kinematics\n```python\ndef planar_ik(\n    x: float,\n    y: float,\n    L1: float,\n    L2: float\n) -> Tuple[float, float, float, float]:\n    \"\"\"Analytical inverse kinematics for 2-link planar arm.\"\"\"\n    D = (x**2 + y**2 - L1**2 - L2**2) \u002F (2 * L1 * L2)\n    if abs(D) > 1:\n        return None\n    \n    theta2 = math.atan2(math.sqrt(1 - D**2), D)\n    theta1 = math.atan2(y, x) - math.atan2(\n        L2 * math.sin(theta2), L1 + L2 * math.cos(theta2)\n    )\n    return theta1, theta2, -theta2, theta1\n\ndef jacobian_ik(\n    target_pose: np.ndarray,\n    current_joints: np.ndarray,\n    T_base: np.ndarray,\n    link_lengths: List[float],\n    iterations: int = 100,\n    alpha: float = 0.1\n) -> np.ndarray:\n    \"\"\"Iterative inverse kinematics using Jacobian.\"\"\"\n    joints = current_joints.copy()\n    for _ in range(iterations):\n        T_current = forward_kinematics([\n            DHParameter(a=link_lengths[i], alpha=0, d=0, theta=joints[i])\n            for i in range(len(joints))\n        ])\n        \n        error = np.zeros(6)\n        error[0:3] = target_pose[0:3, 3] - T_current[0:3, 3]\n        \n        if np.linalg.norm(error) \u003C 1e-4:\n            break\n        \n        J = numerical_jacobian(joints, link_lengths)\n        try:\n            joints += alpha * np.linalg.lstsq(J, error, rcond=None)[0]\n        except:\n            break\n    return joints\n\n# Example: IK for point (1.0, 0.5)\nsolution = planar_ik(1.0, 0.5, 0.8, 0.6)\nif solution:\n    print(f\"Theta1: {solution[0]:.3f} rad ({math.degrees(solution[0]):.1f}°)\")\n    print(f\"Theta2: {solution[1]:.3f} rad ({math.degrees(solution[1]):.1f}°)\")\n```\n\n### Trajectory Planning\n```python\ndef cubic_polynomial(\n    t: float,\n    t0: float,\n    tf: float,\n    p0: float,\n    pf: float,\n    v0: float = 0,\n    vf: float = 0\n) -> Tuple[float, float]:\n    \"\"\"Generate cubic polynomial trajectory.\"\"\"\n    T = tf - t0\n    a0 = p0\n    a1 = v0\n    a2 = 3 * (pf - p0) \u002F T**2 - 2 * v0 \u002F T - vf \u002F T\n    a3 = -2 * (pf - p0) \u002F T**3 + (v0 + vf) \u002F T**2\n    \n    if t \u003C t0:\n        tau = 0\n    elif t > tf:\n        tau = T\n    else:\n        tau = t - t0\n    \n    p = a0 + a1 * tau + a2 * tau**2 + a3 * tau**3\n    v = a1 + 2 * a2 * tau + 3 * a3 * tau**2\n    return p, v\n\ndef quintic_polynomial(\n    t: float,\n    t0: float, tf: float,\n    p0: float, pf: float,\n    v0: float = 0, vf: float = 0,\n    a0: float = 0, af: float = 0\n) -> Tuple[float, float, float]:\n    \"\"\"Generate quintic polynomial with acceleration control.\"\"\"\n    T = tf - t0\n    a0 = p0\n    a1 = v0\n    a2 = a0 \u002F 2\n    a3 = (20 * (pf - p0) - (8 * vf + 12 * v0) - (3 * af - a0) * T) \u002F (2 * T**3)\n    a4 = (30 * (p0 - pf) + (14 * vf + 16 * v0) + (af - 2 * a0) * T) \u002F (2 * T**4)\n    a5 = (12 * (pf - p0) - 6 * (vf + v0) - (af - a0) * T) \u002F (2 * T**5)\n    \n    if t \u003C t0:\n        return p0, v0, a0\n    elif t > tf:\n        return pf, vf, af\n    \n    tau = t - t0\n    p = a0 + a1 * tau + a2 * tau**2 + a3 * tau**3 + a4 * tau**4 + a5 * tau**5\n    v = a1 + 2 * a2 * tau + 3 * a3 * tau**2 + 4 * a4 * tau**3 + 5 * a5 * tau**4\n    a = 2 * a2 + 6 * a3 * tau + 12 * a4 * tau**2 + 20 * a5 * tau**3\n    return p, v, a\n\ndef rrt_star(\n    start: Tuple[float, float],\n    goal: Tuple[float, float],\n    obstacles: List[Tuple[float, float, float]],\n    bounds: Tuple[float, float],\n    max_iter: int = 500,\n    step_size: float = 0.5\n) -> List[Tuple[float, float]]:\n    \"\"\"RRT* path planning algorithm.\"\"\"\n    from scipy.spatial.distance import cdist\n    \n    nodes = [start]\n    parents = [None]\n    costs = [0]\n    \n    for _ in range(max_iter):\n        if np.random.random() \u003C 0.1:\n            rand = goal\n        else:\n            rand = (np.random.uniform(bounds[0], bounds[1]),\n                   np.random.uniform(bounds[0], bounds[1]))\n        \n        nearest_idx = min(range(len(nodes)),\n                         key=lambda i: np.linalg.norm(\n                             np.array(nodes[i]) - np.array(rand)))\n        \n        direction = np.array(rand) - np.array(nodes[nearest_idx])\n        dist = np.linalg.norm(direction)\n        if dist > step_size:\n            direction = direction \u002F dist * step_size\n        \n        new_node = tuple(np.array(nodes[nearest_idx]) + direction)\n        \n        if not collision_check(new_node, obstacles):\n            continue\n        \n        # Find near neighbors\n        near_idx = [i for i in range(len(nodes))\n                   if np.linalg.norm(np.array(nodes[i]) - np.array(new_node)) \u003C step_size * 3]\n        \n        # Connect to best parent\n        best_idx = nearest_idx\n        best_cost = costs[nearest_idx] + step_size\n        for idx in near_idx:\n            cost = costs[idx] + np.linalg.norm(\n                np.array(nodes[idx]) - np.array(new_node))\n            if cost \u003C best_cost:\n                best_cost = cost\n                best_idx = idx\n        \n        nodes.append(new_node)\n        parents.append(best_idx)\n        costs.append(best_cost)\n        \n        # Rewire\n        for idx in near_idx:\n            if idx == best_idx:\n                continue\n            new_cost = costs[best_idx] + np.linalg.norm(\n                np.array(new_node) - np.array(nodes[idx]))\n            if new_cost \u003C costs[idx]:\n                costs[idx] = new_cost\n                parents[idx] = best_idx\n    \n    # Extract path\n    path = [goal]\n    current = goal\n    while current != start:\n        idx = nodes.index(current)\n        current = nodes[parents[idx]]\n        path.append(current)\n    path.reverse()\n    return path\n\n# Example: Trajectory generation\ntrajectory = []\nfor t in np.linspace(0, 2, 100):\n    p, v = cubic_polynomial(t, 0, 2, 0, 1)\n    trajectory.append((p, v))\nprint(f\"Trajectory points: {len(trajectory)}\")\n```\n\n### Computer Vision for Robotics\n```python\ndef camera_calibration(\n    image_points: np.ndarray,\n    object_points: np.ndarray\n) -> Tuple[np.ndarray, np.ndarray]:\n    \"\"\"Perform camera calibration using Zhang's method.\"\"\"\n    return cv.calibrateCamera(object_points, image_points, (640, 480))\n\ndef aruco_detection(\n    image: np.ndarray,\n    marker_dict: cv.aruco.Dictionary_get(cv.aruco.DICT_6X6_250)\n) -> List[dict]:\n    \"\"\"Detect ArUco markers for robot localization.\"\"\"\n    corners, ids, rejected = cv.aruco.detectMarkers(\n        image, marker_dict)\n    return [{\"id\": i[0] if i is not None else None, \n             \"corners\": c} for i, c in zip(ids, corners)]\n\ndef depth_from_stereo(\n    disparity: np.ndarray,\n    focal_length: float,\n    baseline: float\n) -> np.ndarray:\n    \"\"\"Calculate depth from stereo disparity.\"\"\"\n    depth = focal_length * baseline \u002F (disparity + 1e-6)\n    depth[depth \u003C 0] = 0\n    return depth\n\ndef point_cloud_from_depth(\n    depth: np.ndarray,\n    fx: float,\n    fy: float,\n    cx: float,\n    cy: float\n) -> np.ndarray:\n    \"\"\"Generate point cloud from depth image.\"\"\"\n    x, y = np.meshgrid(np.arange(depth.shape[1]), np.arange(depth.shape[0]))\n    X = (x - cx) * depth \u002F fx\n    Y = (y - cy) * depth \u002F fy\n    Z = depth\n    return np.stack([X, Y, Z], axis=-1)\n```\n\n### Robot Control\n```python\ndef jacobian_derivative(\n    q: np.ndarray,\n    dq: np.ndarray,\n    link_lengths: List[float]\n) -> np.ndarray:\n    \"\"\"Calculate time derivative of Jacobian.\"\"\"\n    n = len(q)\n    J = np.zeros((6, n))\n    for i in range(n):\n        J[0, i] = -sum(link_lengths[k] * math.sin(sum(q[:k+1])) \n                       for k in range(i, n)) if i \u003C n - 1 else 0\n        J[1, i] = sum(link_lengths[k] * math.cos(sum(q[:k+1])) \n                       for k in range(i, n)) if i \u003C n - 1 else link_lengths[-1]\n    return J\n\ndef computed_torque_control(\n    q_des: np.ndarray,\n    dq_des: np.ndarray,\n    ddq_des: np.ndarray,\n    q: np.ndarray,\n    dq: np.ndarray,\n    M: np.ndarray,\n    C: np.ndarray,\n    G: np.ndarray,\n    Kp: np.ndarray,\n    Kd: np.ndarray\n) -> np.ndarray:\n    \"\"\"Computed torque control with PD feedback.\"\"\"\n    e = q_des - q\n    de = dq_des - dq\n    tau_feedforward = M @ ddq_des + C @ dq_des + G\n    tau_feedback = Kp @ e + Kd @ de\n    return tau_feedforward + tau_feedback\n\ndef impedance_control(\n    x: np.ndarray,\n    dx: np.ndarray,\n    xd: np.ndarray,\n    dxd: np.ndarray,\n    M_d: np.ndarray,\n    B_d: np.ndarray,\n    K_d: np.ndarray,\n    F_ext: np.ndarray\n) -> np.ndarray:\n    \"\"\"Impedance control for force regulation.\"\"\"\n    e = x - xd\n    de = dx - dxd\n    F_desired = M_d @ (-ddx_des if False else np.zeros(3)) + B_d @ de + K_d @ e\n    return F_desired + F_ext\n\n# Example: PD controller for joint control\nKp = 100 * np.eye(6)\nKd = 20 * np.eye(6)\nq_des = np.array([0.5, 0.3, -0.2, 0, 0, 0])\ndq_des = np.zeros(6)\nddq_des = np.zeros(6)\nq_current = np.array([0.4, 0.25, -0.15, 0, 0, 0])\ndq_current = np.array([0.1, 0.05, -0.03, 0, 0, 0])\n```\n\n## Best Practices\n- Use simulation (Gazebo, Webots) before hardware deployment\n- Implement safety stops and limit switches in hardware\n- Consider workspace constraints and singularities in motion planning\n- Use proper coordinate frames (world, base, tool, camera)\n- Account for calibration errors and thermal drift\n- Implement smooth trajectory generation with velocity\u002Facceleration limits\n- Use redundancy resolution for obstacle avoidance\n- Consider sensor fusion for improved state estimation\n- Implement graceful degradation for sensor failures\n- Document robot configuration and calibration parameters\n",{"name":5,"license":14,"metadata":29,"description":7,"compatibility":20},{"audience":30,"category":19},"engineers","main","5f7a3e453c98261f93d19a6a7de44ad8f7b72d41","engineering\u002Frobotics",2,"https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk","2026-03-01 06:55:40",{"source":8,"skillName":5,"commands":39,"prompt":49,"zipAvailable":50},[40,43,46],{"tool":41,"command":42},"npx","npx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill robotics",{"tool":44,"command":45},"bunx","bunx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill robotics",{"tool":47,"command":48},"pnpm","pnpm dlx skills add ffsshhttiikk\u002Fopencode-agents-skills --skill robotics","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fengineering\u002Frobotics\u002FSKILL.md",true,[52,58],{"path":53,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":56,"sourceHtmlUrl":57},"scripts\u002Frest_request.py","SCRIPT","脚本",13525,"https:\u002F\u002Fgithub.com\u002Filderaj\u002Fagent-plugin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fcodex--life-science-research\u002Fskills\u002Feqtl-catalogue-skill\u002Fscripts\u002Frest_request.py",{"path":59,"resourceType":54,"resourceTypeDesc":55,"sizeBytes":60,"sourceHtmlUrl":61},"scripts\u002Ftest_rest_request.py",3299,"https:\u002F\u002Fgithub.com\u002Filderaj\u002Fagent-plugin-marketplace\u002Fblob\u002Fmain\u002Fplugins\u002Fcodex--life-science-research\u002Fskills\u002Feqtl-catalogue-skill\u002Fscripts\u002Ftest_rest_request.py",[63,74,84,93,103,112],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":24},"01M6CXT9TXDF79BWJTMQAPB49G","xamarin","Xamarin cross-platform development","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fxamarin\u002FSKILL.md",[],[65,70,71,72,20,73],"platform","cross-platform","mobile","development",{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":24},"01M6CXT8AD04MFYDA32VW3FKAG","wrangling","Data wrangling fundamentals","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwrangling\u002FSKILL.md",[],[76,81,20,82,83],"data wrangling","science","data",{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":24},"01M6CXT717GCN7SRRNPBDP4508","windows","Windows operating system administration and scripting","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwindows\u002FSKILL.md",[],[86,91,20,92],"system","scripting",{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":24},"01M6CXT54K794NMEM3XAPZZDKT","wide-column","Wide-column data model","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column\u002FSKILL.md",[],[100,101,20,102,83],"wide column","databases","model",{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":24},"01M6CXT28FMT2P4V9GZE67WA8E","wide-column-stores","Wide-column database stores","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwide-column-stores\u002FSKILL.md",[],[110,101,20,111],"wide column stores","database",{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":24},"01M6CXT0D0M0Q4T2N7C2RX7DSN","websockets","WebSocket implementation and best practices","https:\u002F\u002Fgithub.com\u002Fffsshhttiikk\u002Fopencode-agents-skills\u002Fblob\u002Fmain\u002Fwebsockets\u002FSKILL.md",[],[114,119,120,121,20,122,123],"websocket","real-time","time","best practices","implementation"]