Skip to content

fix SDK build and Python packaging for ubuntu 20.04#7

Open
Rorschach2333 wants to merge 2 commits into
HighTorque-Robotics:mainfrom
Rorschach2333:fix/sdk-build-python-install
Open

fix SDK build and Python packaging for ubuntu 20.04#7
Rorschach2333 wants to merge 2 commits into
HighTorque-Robotics:mainfrom
Rorschach2333:fix/sdk-build-python-install

Conversation

@Rorschach2333

Copy link
Copy Markdown

中文

本 PR 修复 Panthera-HT SDK 的构建与安装问题:

  • 兼容 CMake 4.x
  • 统一 hightorque_motor CMake 包名和导出目标
  • 修复 Python 绑定链接错误
  • 支持将 Python 扩展正确安装到 site-packages
  • 修复 conda Python 解释器选择
  • 兼容 robot.namerobot.robot_name
  • 串口设备缺失时返回明确错误,避免段错误
  • 更新相关 README 和构建流程

已验证:

  • motor_cpp 完整编译成功
  • Python wheel 构建成功
  • Python 包可在任意目录导入

English

This PR fixes build and installation issues in the Panthera-HT SDK:

  • Add CMake 4.x compatibility
  • Align the hightorque_motor CMake package and exported target names
  • Fix Python binding linkage
  • Install the Python extension correctly into site-packages
  • Use the correct Python interpreter in conda environments
  • Support both robot.name and robot.robot_name
  • Report missing serial devices clearly instead of crashing
  • Update the related README files and build instructions

Validated:

  • Full motor_cpp build succeeds
  • Python wheel builds successfully
  • The Python package imports correctly from any directory

Copilot AI review requested due to automatic review settings June 14, 2026 15:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR standardizes the SDK naming and build/install workflow across C++ and Python, aligning the exported CMake package name with hightorque_motor and updating docs and configs accordingly.

Changes:

  • Switch Python binding and CMake integration to depend on hightorque_motor (exported target hightorque_motor::hightorque_motor) instead of hightorque_robot.
  • Update build/install instructions to modern CMake (-S/-B, cmake --build, cmake --install) and pip-based Python installs.
  • Update robot YAML naming (robot.namerobot.robot_name) and make C++ config parsing backward-compatible.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
panthera_python/setup.py Passes Python3_EXECUTABLE to CMake to match find_package(Python3 ...).
panthera_python/scripts/motor_example/motor_README.md Updates build commands and pip usage in example docs.
panthera_python/robot_param/Leader.yaml Renames YAML key to robot_name.
panthera_python/robot_param/Follower.yaml Renames YAML key to robot_name.
panthera_python/hightorque_robot/init.py Adds package init to re-export pybind symbols.
panthera_python/README.md Clarifies module/package relationships; updates build/install + verification steps.
panthera_python/CMakeLists.txt Links Python extension against hightorque_motor::hightorque_motor; adjusts output dir logic.
panthera_cpp/robot_cpp/README.md Clarifies build boundaries for robot_cpp vs installed motor SDK.
panthera_cpp/motor_cpp/src/hardware/robot.cpp Improves YAML validation/backward compatibility; adds serial_id range check.
panthera_cpp/motor_cpp/doc/CLAUDE.md Updates build/install instructions to modern CMake commands.
panthera_cpp/motor_cpp/cmake/hightorque_robotConfig.cmake.in Updates package config contents to hightorque_motor naming and targets.
panthera_cpp/motor_cpp/README.md Documents package/target names and updated build/install instructions.
panthera_cpp/motor_cpp/CMakeLists.txt Raises CMake minimum version; switches config template filename to hightorque_motorConfig.cmake.in.
panthera_cpp/README.md Adds naming mapping and clarifies when installing motor_cpp is required.
Updates a usage guide to hightorque_motor naming and modern CMake workflow, but file path is missing in the diff metadata.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0.2)
cmake_minimum_required(VERSION 3.5)
Comment on lines +100 to 103
${CMAKE_CURRENT_SOURCE_DIR}/cmake/hightorque_motorConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/hightorque_motorConfig.cmake
INSTALL_DESTINATION lib/cmake/hightorque_motor
)
Comment thread panthera_python/README.md
python -c "import hightorque_robot; print('电机 SDK 安装成功')"
python -c "import pinocchio as pin; print('pin 安装成功')"
python -c "import yaml; print('pyyaml 安装成功')"
python -c "from hightorque_robot import _hightorque_robot; print('电机 SDK 安装成功')"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants