Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
|
|
7 months ago | |
|---|---|---|
| .. | ||
| nodes | 7 months ago | |
| README.md | 7 months ago | |
| control.yml | 7 months ago | |
| control_advanced.yml | 7 months ago | |
This example demonstrates Cartesian space control using two different approaches: Direct Inverse Kinematics(IK)(Basic) and Differential IK(advance). Both create a Controller node that processes target pose commands and outputs joint commands using dora-pytorch-kinematics.
control.yml)control_advanced.yml)cd target_pose_control
dora build control.yml
dora run control.yml
cd target_pose_control
dora build control_advanced.yml
dora run control_advanced.yml
You should see:
pose_publisher.py)class PosePublisher:
def __init__(self):
# Predefined sequence of target poses [x, y, z, roll, pitch, yaw]
self.target_poses = [
[0.5, 0.5, 0.3, 180.0, 0.0, 90.0], # Position + RPY orientation
[0.6, 0.2, 0.5, 180.0, 0.0, 45.0], # Different orientation
# ... more poses
]
target_pose array [x, y, z, roll, pitch, yaw]controller_ik.py)How it works:
[x, y, z, roll, pitch, yaw]dora-pytorch-kinematicsAdvantages:
Disadvantages:
controller_differential_ik.py)How it works:
pos_error = target_pos - current_ee_pos
twist[:3] = Kpos * pos_error / integration_dt # Linear velocity
twist[3:] = Kori * rot_error / integration_dt # Angular velocity
# Damped least squares to avoid singularities
dq = J^T @ (J @ J^T + λI)^(-1) @ twist
new_joints = current_joints + dq * dt
Advantages:
dora-pytorch-kinematics)A dedicated kinematics computation node that provides three core robotic functions:
- id: pytorch_kinematics
build: pip install -e ../../../node-hub/dora-pytorch-kinematics
path: dora-pytorch-kinematics
inputs:
ik_request: controller/ik_request # For inverse kinematics
fk_request: controller/fk_request # For forward kinematics
jacobian_request: controller/jacobian_request # For Jacobian computation
outputs:
- ik_request # Joint solution for target pose
- fk_request # End-effector pose for joint configuration
- jacobian_request # Jacobian matrix for velocity mapping
env:
URDF_PATH: "../URDF/franka_panda/panda.urdf"
END_EFFECTOR_LINK: "panda_hand"
TRANSFORM: "0. 0. 0. 1. 0. 0. 0."
Inverse Kinematics (IK)
[x, y, z, roll, pitch, yaw] or [x, y, z, qw, qx, qy, qz] + current joint stateForward Kinematics (FK)
[x, y, z, qw, qx, qy, qz]Jacobian Computation
Configuration:
Usage in Controllers:
ik_request → ik_resultfk_request → fk_result and jacobian_request → jacobian_resultdora-mujoco)This controller design draws inspiration from the kinematic control strategies presented in mjctrl, specifically the differential ik control example.
The URDF model for the robotic arms was sourced from the PyBullet GitHub repository. Or you could google search the robot and get its urdf.
DORA (Dataflow-Oriented Robotic Architecture) is middleware designed to streamline and simplify the creation of AI-based robotic applications. It offers low latency, composable, and distributed datafl
Rust Python TOML Markdown C other