标定边界上移到 invicta_hardware: - raw↔model 的 dir/offset 由 hardware 独家施加(话题收发都是模型帧), deploy 的 InvictaInterface 退化为透传,invicta_deploy.toml 不再有 dir/offset_deg。 这样 [joint_limits](模型帧)与被限幅的指令同帧,/joint_states 也是模型角。 关节选择(部分接入 / 单腿调试): - JointCommandArray 的 name 即本次要控制的关节子集(空 = 全部已配置关节)。 - 未选中的关节写「零力矩自由」块,而不是留全 0——按协议 (0,0,0,0,0) 会解码成 P_MIN/V_MIN/T_MIN,其中 tau=T_MIN(摆臂 -100 N·m)是危险的前馈力矩。 - 新增 control_word kSetZero(6) -> 0xEF,只作用于选中的摆臂(轮毂不支持,跳过)。 调试脚本 invicta_hardware/scripts/hw_debug_test.py: - 只起 hardware 节点调试:monitor/damping/angle/wheel/offset/zero 六种模式 + --joints。 - 限幅参数硬编码;发指令时默认回显模型角。 构建:toml++ 改为 vendored single-header(三个包各 third_party/tomlplusplus/toml++/toml.hpp), 去掉 find_package(tomlplusplus) 与 -DTOML_HEADER_ONLY(单头自带 header-only)。 已在容器(localhost/custom-ros-noetic)中全新 catkin_make + smoke_test 验证通过。
55 lines
1.4 KiB
CMake
55 lines
1.4 KiB
CMake
cmake_minimum_required(VERSION 3.0.2)
|
||
project(invicta_remote)
|
||
|
||
set(CMAKE_CXX_STANDARD 17)
|
||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||
|
||
if(NOT CMAKE_BUILD_TYPE)
|
||
set(CMAKE_BUILD_TYPE Release)
|
||
endif()
|
||
|
||
find_package(catkin REQUIRED COMPONENTS
|
||
roscpp
|
||
sensor_msgs
|
||
invicta_msgs
|
||
roslib
|
||
)
|
||
|
||
catkin_package(
|
||
INCLUDE_DIRS include
|
||
CATKIN_DEPENDS roscpp sensor_msgs invicta_msgs
|
||
)
|
||
|
||
# TOML 解析库:single-header,vendored 在 third_party/tomlplusplus/toml++/toml.hpp
|
||
# 单头版本本身就是 header-only(自带 TOML_HEADER_ONLY),实现直接编进本节点:无 find_package、无运行时库依赖
|
||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/tomlplusplus)
|
||
|
||
include_directories(
|
||
include
|
||
${catkin_INCLUDE_DIRS}
|
||
)
|
||
|
||
# 把本节点自己的配置头列进源列表:改该头会触发重编(改 TOML 不用重编)
|
||
set(NODE_CONFIG_HEADER "${CMAKE_CURRENT_SOURCE_DIR}/include/invicta_remote/remote_config.h")
|
||
if(NOT EXISTS "${NODE_CONFIG_HEADER}")
|
||
message(WARNING "invicta_remote_node: 找不到本节点配置头")
|
||
set(NODE_CONFIG_HEADER "")
|
||
endif()
|
||
|
||
add_executable(invicta_remote_node
|
||
src/invicta_remote_node.cpp
|
||
${NODE_CONFIG_HEADER}
|
||
)
|
||
|
||
target_link_libraries(invicta_remote_node
|
||
${catkin_LIBRARIES}
|
||
-lpthread
|
||
)
|
||
|
||
install(TARGETS invicta_remote_node
|
||
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
|
||
)
|
||
install(DIRECTORY launch config
|
||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
|
||
)
|