# ROS2 Humble下GetCartesianPath无法设置速度加速度缩放因子

> 原文链接：https://robotics.hellobike.com/pitfalls/2026-11-12-franka-ros2-219
> 频道：pitfalls | 更新日期：2026-11-12 | 标签：auto, github-issue, franka_ros2
> 核心摘要：Humble版moveit_msgs缺失缩放字段，需在客户端对返回轨迹手动时间参数化或升级至Jazzy。

# ROS2 Humble下GetCartesianPath无法设置速度加速度缩放因子

::: v-pre
> 本文由 AI 根据公开内容整理，可能有误，请以原文为准：[ros2 moveit velocity and acceleration scale factor problem](https://github.com/frankarobotics/franka_ros2/issues/219)（GitHub frankaemika/franka_ros2 #219）

**状态**：有绕过办法

## 问题

在Ubuntu 22.04与ROS2 Humble环境下使用franka_ros2调用GetCartesianPath.Request()规划笛卡尔路径时，无法通过API设置max_velocity_scaling_factor和max_acceleration_scaling_factor属性。RViz GUI可正常控制速度，但Python脚本无效，而MotionPlanRequest功能正常。

## 环境

Ubuntu 22.04, ROS2 Humble, moveit_msgs 2.2.1, franka_ros2

## 解决办法

1. 确认问题源于ROS2 Humble搭载的moveit_msgs 2.2.1版本过旧，其GetCartesianPath.Request消息定义中缺失速度/加速度缩放因子字段，导致服务端仅执行路径插值而不进行时间参数化。
2. 采用客户端后处理方案：获取服务返回的RobotTrajectory后，在本地对其应用时间参数化算法（如TOTG）并手动设置速度与加速度缩放，再将处理后的轨迹发送至/execute_trajectory接口执行。
3. 或采用环境升级方案：将系统迁移至ROS2 Jazzy或更新MoveIt 2至新版，新版GetCartesianPath.Request已原生包含max_velocity_scaling_factor与max_acceleration_scaling_factor字段，可直接在服务端完成带缩放的轨迹规划。

讨论原作者：@Drorness 等，版权归原作者所有。
:::

## 原始参考来源 (Sources)

- [GitHub frankaemika/franka_ros2 #219：ros2 moveit velocity and acceleration scale factor problem](https://github.com/frankarobotics/franka_ros2/issues/219)