Logo Xingxin on Bug

HKUST PhD Chronicle, Week 11, Trajectory

October 31, 2025
2 min read

This week I began tackling Cartesian motion control in libfranka: C++ library for Franka Robotics research robots . By “control” I mean: supply the exact pose every Δt=1ms\Delta t=1ms. I have never worked at this level. My previous robot experience was with KUKA, where a Cartesian move is a one-liner:

$VEL.CP = 0.5 ;
LIN {X 100, Y 0, Z 500, A 0, B 90, C 0}

Franka expects the opposite: you stream the pose yourself, millisecond by millisecond.

// the control is invoked at every 1ms
robot.control([&](const franka::RobotState& robot_state,
                  franka::Duration period) -> franka::CartesianPose {
  // (calculation...)
  // return 4×4 homogeneous matrix as std::array<double,16> (column-major)
});

Remark

The std::array<double, 16> is a column major of homogeneous transformation matrix .

Trajectory generation is textbook robotic and it’s fundamental for student in this field. Yet a a software engineer I had only ever called higher-level APIs. Now I’m working at the 1ms level for the first time.

Remark

I’ll dedicate a future post to the actual math and code for generating these trajectories.

Luckily, two books from the library saved me. I would like to share with you.

  1. Modern Robotics: Mechanics, Planning, and Control
  2. Introduction to Robotics: Mechanics and Control