Compare commits
No commits in common. "main" and "backup/local-arm-ui-workflow-20260923" have entirely different histories.
main
...
backup/loc
6
.gitignore
vendored
6
.gitignore
vendored
@ -3,7 +3,6 @@
|
||||
/Makefile
|
||||
/Makefile.*
|
||||
/object_script.*
|
||||
/*_resource.rc
|
||||
/bin/
|
||||
/build/
|
||||
/build_*/
|
||||
@ -20,8 +19,3 @@
|
||||
*.pfx
|
||||
*.p12
|
||||
*.key
|
||||
/build-*/
|
||||
/.qtcreator/
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
/am-freescan/
|
||||
|
||||
462
CMakeLists.txt
462
CMakeLists.txt
@ -1,313 +1,116 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(CmvrControlStation VERSION 1.0.0 LANGUAGES CXX)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_CURRENT_SOURCE_DIR}/ui")
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
if(WIN32)
|
||||
set(CMVR_MSQUIC_DEFAULT ON)
|
||||
else()
|
||||
set(CMVR_MSQUIC_DEFAULT OFF)
|
||||
endif()
|
||||
option(CMVR_WITH_MSQUIC "Build the embedded MsQuic test server" ${CMVR_MSQUIC_DEFAULT})
|
||||
set(CMVR_MSQUIC_ROOT "" CACHE PATH "Optional MsQuic installation prefix on Linux")
|
||||
set(CMVR_CXX_RUNTIME "" CACHE FILEPATH
|
||||
"Optional libstdc++.so.6 matching a non-system Linux dependency prefix")
|
||||
set(CMVR_ASSIMP_SCENE_PARSER "" CACHE FILEPATH
|
||||
"Qt3D Assimp scene parser plugin used for URDF mesh files")
|
||||
|
||||
set(CMVR_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
set(CMVR_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/lib")
|
||||
set(CMVR_TOOLS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tools")
|
||||
set(CMVR_CERT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/certs")
|
||||
set(PROTO_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/protos")
|
||||
set(GENERATED_ROOT "${CMAKE_CURRENT_BINARY_DIR}/generated_cpp")
|
||||
set(PROTOC "${CMVR_TOOLS_DIR}/run_protoc.cmd")
|
||||
set(GRPC_CPP_PLUGIN "${CMVR_TOOLS_DIR}/grpc_cpp_plugin.exe")
|
||||
|
||||
foreach(REQUIRED_FILE IN ITEMS
|
||||
"${PROTOC}"
|
||||
"${GRPC_CPP_PLUGIN}"
|
||||
"${CMVR_LIB_DIR}/libgrpc++.a"
|
||||
"${CMVR_LIB_DIR}/libprotobuf.a"
|
||||
"${CMVR_LIB_DIR}/libavcodec.dll.a"
|
||||
"${CMVR_LIB_DIR}/liburdfdom_model.dll.a"
|
||||
"${CMVR_LIB_DIR}/msquic.dll")
|
||||
if(NOT EXISTS "${REQUIRED_FILE}")
|
||||
message(FATAL_ERROR "Required local dependency not found: ${REQUIRED_FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
find_package(Qt5 5.12 REQUIRED COMPONENTS
|
||||
Core Gui Widgets Svg Network Multimedia 3DCore 3DRender 3DExtras 3DInput 3DAnimation)
|
||||
Core Gui Widgets Multimedia 3DCore 3DRender 3DExtras 3DInput)
|
||||
|
||||
get_target_property(CMVR_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
|
||||
if(CMVR_QMAKE_EXECUTABLE)
|
||||
execute_process(
|
||||
COMMAND "${CMVR_QMAKE_EXECUTABLE}" -query QT_INSTALL_PLUGINS
|
||||
OUTPUT_VARIABLE CMVR_QT_PLUGIN_ROOT
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
endif()
|
||||
if(NOT CMVR_ASSIMP_SCENE_PARSER)
|
||||
find_file(CMVR_ASSIMP_SCENE_PARSER
|
||||
NAMES assimpsceneimport.dll assimpsceneimportd.dll libassimpsceneimport.so
|
||||
HINTS
|
||||
"${CMVR_QT_PLUGIN_ROOT}/sceneparsers"
|
||||
"/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}/qt5/plugins/sceneparsers")
|
||||
endif()
|
||||
if(NOT CMVR_ASSIMP_SCENE_PARSER OR NOT EXISTS "${CMVR_ASSIMP_SCENE_PARSER}")
|
||||
message(FATAL_ERROR
|
||||
"Qt3D's Assimp scene parser was not found. It is required to display "
|
||||
"STL, DAE, and 3DS meshes from bundled URDF models. On Ubuntu install "
|
||||
"qt3d-assimpsceneimport-plugin, or set CMVR_ASSIMP_SCENE_PARSER to the "
|
||||
"plugin file supplied by the selected Qt installation.")
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
# The checked-in native libraries use the Qt 5.12.4 MinGW 7.3 64-bit ABI.
|
||||
set(PROTOC "${CMVR_TOOLS_DIR}/run_protoc.cmd")
|
||||
set(GRPC_CPP_PLUGIN "${CMVR_TOOLS_DIR}/grpc_cpp_plugin.exe")
|
||||
foreach(REQUIRED_FILE IN ITEMS
|
||||
"${PROTOC}"
|
||||
"${GRPC_CPP_PLUGIN}"
|
||||
"${CMVR_LIB_DIR}/libgrpc++.a"
|
||||
"${CMVR_LIB_DIR}/libprotobuf.a"
|
||||
"${CMVR_LIB_DIR}/libavcodec.dll.a"
|
||||
"${CMVR_LIB_DIR}/liburdfdom_model.dll.a")
|
||||
if(NOT EXISTS "${REQUIRED_FILE}")
|
||||
message(FATAL_ERROR "Required Windows dependency not found: ${REQUIRED_FILE}")
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
find_package(Protobuf CONFIG QUIET)
|
||||
if(NOT Protobuf_FOUND)
|
||||
find_package(Protobuf REQUIRED)
|
||||
endif()
|
||||
find_package(gRPC CONFIG REQUIRED)
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET
|
||||
libavcodec libavutil libswscale)
|
||||
find_path(CMVR_URDFDOM_INCLUDE_DIR urdf_parser/urdf_parser.h
|
||||
PATH_SUFFIXES include include/urdfdom)
|
||||
find_path(CMVR_TINYXML_INCLUDE_DIR tinyxml.h PATH_SUFFIXES include)
|
||||
find_library(CMVR_URDFDOM_MODEL_LIBRARY NAMES urdfdom_model)
|
||||
if(NOT CMVR_URDFDOM_INCLUDE_DIR OR NOT CMVR_TINYXML_INCLUDE_DIR OR
|
||||
NOT CMVR_URDFDOM_MODEL_LIBRARY)
|
||||
message(FATAL_ERROR
|
||||
"urdfdom/tinyxml was not found. Install liburdfdom-dev or add its prefix "
|
||||
"to CMAKE_PREFIX_PATH.")
|
||||
endif()
|
||||
|
||||
if(NOT TARGET protobuf::protoc)
|
||||
message(FATAL_ERROR "The Protobuf package does not provide protobuf::protoc")
|
||||
endif()
|
||||
if(NOT TARGET gRPC::grpc_cpp_plugin)
|
||||
message(FATAL_ERROR "The gRPC package does not provide gRPC::grpc_cpp_plugin")
|
||||
endif()
|
||||
set(PROTOC "$<TARGET_FILE:protobuf::protoc>")
|
||||
set(GRPC_CPP_PLUGIN "$<TARGET_FILE:gRPC::grpc_cpp_plugin>")
|
||||
|
||||
# A Conda-provided Qt/gRPC stack may carry an older libstdc++ than the
|
||||
# host compiler. Link against the runtime next to the imported dependency
|
||||
# so symbol versions selected at link time match the library loaded from
|
||||
# the generated RUNPATH. System packages resolve to the system runtime.
|
||||
if(NOT CMVR_CXX_RUNTIME)
|
||||
foreach(DEPENDENCY_TARGET IN ITEMS gRPC::grpc++ Qt5::Core)
|
||||
get_target_property(DEPENDENCY_LOCATION
|
||||
${DEPENDENCY_TARGET} IMPORTED_LOCATION_RELEASE)
|
||||
if(NOT DEPENDENCY_LOCATION)
|
||||
get_target_property(DEPENDENCY_LOCATION
|
||||
${DEPENDENCY_TARGET} IMPORTED_LOCATION)
|
||||
endif()
|
||||
if(DEPENDENCY_LOCATION)
|
||||
get_filename_component(DEPENDENCY_LIB_DIR
|
||||
"${DEPENDENCY_LOCATION}" DIRECTORY)
|
||||
if(EXISTS "${DEPENDENCY_LIB_DIR}/libstdc++.so.6")
|
||||
set(CMVR_CXX_RUNTIME
|
||||
"${DEPENDENCY_LIB_DIR}/libstdc++.so.6")
|
||||
message(STATUS
|
||||
"Using dependency-prefix C++ runtime: ${CMVR_CXX_RUNTIME}")
|
||||
break()
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CMVR_WITH_MSQUIC)
|
||||
if(WIN32)
|
||||
if(NOT EXISTS "${CMVR_INCLUDE_DIR}/msquic.h" OR
|
||||
NOT EXISTS "${CMVR_LIB_DIR}/msquic.dll")
|
||||
message(FATAL_ERROR
|
||||
"CMVR_WITH_MSQUIC is enabled, but include/msquic.h or lib/msquic.dll is missing")
|
||||
endif()
|
||||
set(CMVR_MSQUIC_INCLUDE_DIR "${CMVR_INCLUDE_DIR}")
|
||||
else()
|
||||
find_path(CMVR_MSQUIC_INCLUDE_DIR msquic.h
|
||||
HINTS "${CMVR_MSQUIC_ROOT}"
|
||||
PATH_SUFFIXES include)
|
||||
find_library(CMVR_MSQUIC_LIBRARY NAMES msquic
|
||||
HINTS "${CMVR_MSQUIC_ROOT}"
|
||||
PATH_SUFFIXES lib lib64)
|
||||
if(NOT CMVR_MSQUIC_INCLUDE_DIR OR NOT CMVR_MSQUIC_LIBRARY)
|
||||
message(FATAL_ERROR
|
||||
"CMVR_WITH_MSQUIC=ON requires a Linux MsQuic installation. "
|
||||
"Set CMVR_MSQUIC_ROOT or configure with -DCMVR_WITH_MSQUIC=OFF.")
|
||||
endif()
|
||||
get_filename_component(CMVR_MSQUIC_LIBRARY_DIR
|
||||
"${CMVR_MSQUIC_LIBRARY}" DIRECTORY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(CMVR_SOURCES
|
||||
src/agvvelocityramp.h
|
||||
src/seeragvmapclient.cpp
|
||||
src/seeragvmapclient.h
|
||||
src/agvmapdocument.cpp
|
||||
src/agvmapdocument.h
|
||||
src/agvmaprasterizer.cpp
|
||||
src/agvmaprasterizer.h
|
||||
src/agvmapeditorwidget.cpp
|
||||
src/agvmapeditorwidget.h
|
||||
src/agvmapviewwidget.cpp
|
||||
src/agvmapviewwidget.h
|
||||
add_executable(CmvrControlStation WIN32
|
||||
src/audiostreammanager.cpp
|
||||
src/audiostreammanager.h
|
||||
src/jointfloweditor.cpp
|
||||
src/jointfloweditor.h
|
||||
src/motordebugwidget.h
|
||||
src/motordebugwidget.cpp
|
||||
src/motorplot.h
|
||||
src/motorplot.cpp
|
||||
src/jointpointdata.h
|
||||
src/configeditorwidget.cpp
|
||||
src/configeditorwidget.h
|
||||
src/main.cpp
|
||||
src/mainwindow.cpp
|
||||
src/mainwindow_ui.cpp
|
||||
src/mainwindow.h
|
||||
src/taskorchestrationwidget.cpp
|
||||
src/taskapi.cpp
|
||||
src/taskjointeditor.h
|
||||
src/taskuilabels.h
|
||||
src/taskprotoeditor.cpp
|
||||
src/demosimulator.cpp
|
||||
src/demosimulator.h
|
||||
src/workflowcanvas.h
|
||||
src/workflowgraph.h
|
||||
src/workflowruntime.h
|
||||
src/workflowrobotmanager.h
|
||||
src/workflowhistory.h
|
||||
src/freescaninteropui.h
|
||||
src/freescaninterop.cpp
|
||||
src/freescaninterop.h
|
||||
src/taskdeviceoptions.cpp
|
||||
src/taskdeviceoptions.h
|
||||
src/taskrpcrunner.cpp
|
||||
src/taskorchestrationwidget.h
|
||||
src/quictestserver.cpp
|
||||
src/quictestserver.h
|
||||
src/rpcservicewidget.cpp
|
||||
src/rpcservicewidget.h
|
||||
src/robotclient.cpp
|
||||
src/robotclient.h
|
||||
src/tactileheatmapwidget.cpp
|
||||
src/tactileheatmapwidget.h
|
||||
src/trendwidget.cpp
|
||||
src/trendwidget.h
|
||||
src/uiicons.h
|
||||
src/urdfviewerwidget.cpp
|
||||
src/urdfviewerwidget.h
|
||||
src/videodecoder.cpp
|
||||
src/videodecoder.h
|
||||
src/camerasnapshotdecoder.h
|
||||
src/snapshotimageview.h
|
||||
src/videoframe.h
|
||||
src/videorenderwidget.cpp
|
||||
src/videorenderwidget.h
|
||||
ui/handeyecalibrationwidget.cpp
|
||||
ui/handeyecalibrationwidget.h
|
||||
ui/handeyecalibrationwidget.ui
|
||||
ui/mainwindow.ui
|
||||
ui/systemservicepage.ui
|
||||
ui/armservicepage.ui
|
||||
ui/cameraservicepage.ui
|
||||
ui/agvservicepage.ui
|
||||
ui/agvstatusdialog.ui
|
||||
ui/audioservicepage.ui
|
||||
ui/quicserverpage.ui
|
||||
ui/diagnosticspage.ui
|
||||
ui/rpcservicewidget.ui
|
||||
resources.qrc)
|
||||
|
||||
list(APPEND CMVR_SOURCES
|
||||
src/applicationsettings.cpp src/applicationsettings.h
|
||||
src/applicationstyle.cpp src/applicationstyle.h
|
||||
src/appmessagebox.h
|
||||
src/handeyebridge.cpp src/handeyebridge.h src/handeyeprocessworker.h
|
||||
src/handeyestore.cpp src/handeyestore.h
|
||||
src/handeyeurdf.cpp src/handeyeurdf.h
|
||||
src/touchplanner.cpp src/touchplanner.h
|
||||
src/touchsequencecontroller.cpp src/touchsequencecontroller.h
|
||||
src/touchvideowidget.cpp src/touchvideowidget.h
|
||||
src/touchplanestore.cpp src/touchplanestore.h src/cameracapabilities.h src/bioheadoperations.h
|
||||
src/bioheadwidget.cpp src/bioheadwidget.h
|
||||
src/bioheadjointclient.cpp src/bioheadjointclient.h
|
||||
src/bioheadexpressionstore.cpp src/bioheadexpressionstore.h
|
||||
src/touchoperationwidget.cpp src/touchoperationwidget.h
|
||||
src/handeyemotionwidget.cpp src/handeyemotionwidget.h
|
||||
src/tcpcalibration.cpp src/tcpcalibration.h
|
||||
src/tcpjogcontroller.cpp src/tcpjogcontroller.h
|
||||
src/tcptoolstore.cpp src/tcptoolstore.h
|
||||
src/tcpcalibrationwidget.cpp src/tcpcalibrationwidget.h)
|
||||
add_executable(CmvrControlStation ${CMVR_SOURCES})
|
||||
if(MINGW)
|
||||
target_compile_options(CmvrControlStation PRIVATE -Wa,-mbig-obj)
|
||||
endif()
|
||||
if(WIN32)
|
||||
target_sources(CmvrControlStation PRIVATE resources/application.rc)
|
||||
set_target_properties(CmvrControlStation PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
endif()
|
||||
|
||||
set_target_properties(CmvrControlStation PROPERTIES
|
||||
DEBUG_POSTFIX "_d"
|
||||
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin/$<LOWER_CASE:$<CONFIG>>")
|
||||
|
||||
target_compile_definitions(CmvrControlStation PRIVATE
|
||||
CMVR_WITH_GRPC=1
|
||||
CMVR_WITH_MSQUIC=$<BOOL:${CMVR_WITH_MSQUIC}>)
|
||||
if(WIN32)
|
||||
target_compile_definitions(CmvrControlStation PRIVATE _WIN32_WINNT=0x0600)
|
||||
endif()
|
||||
|
||||
target_include_directories(CmvrControlStation PRIVATE "${GENERATED_ROOT}")
|
||||
if(WIN32)
|
||||
target_include_directories(CmvrControlStation PRIVATE
|
||||
"${CMVR_INCLUDE_DIR}"
|
||||
"${CMVR_INCLUDE_DIR}/urdfdom_headers")
|
||||
else()
|
||||
target_include_directories(CmvrControlStation PRIVATE
|
||||
"${CMVR_URDFDOM_INCLUDE_DIR}"
|
||||
"${CMVR_TINYXML_INCLUDE_DIR}"
|
||||
"${CMVR_INCLUDE_DIR}/urdfdom_headers")
|
||||
endif()
|
||||
if(CMVR_WITH_MSQUIC)
|
||||
target_include_directories(CmvrControlStation PRIVATE "${CMVR_MSQUIC_INCLUDE_DIR}")
|
||||
if(UNIX AND CMVR_MSQUIC_LIBRARY_DIR)
|
||||
set_property(TARGET CmvrControlStation APPEND PROPERTY
|
||||
BUILD_RPATH "${CMVR_MSQUIC_LIBRARY_DIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
_WIN32_WINNT=0x0600 CMVR_WITH_GRPC=1)
|
||||
target_include_directories(CmvrControlStation PRIVATE
|
||||
"${CMVR_INCLUDE_DIR}"
|
||||
"${CMVR_INCLUDE_DIR}/urdfdom_headers"
|
||||
"${GENERATED_ROOT}")
|
||||
target_link_libraries(CmvrControlStation PRIVATE
|
||||
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Svg Qt5::Network Qt5::Multimedia
|
||||
Qt5::3DCore Qt5::3DRender Qt5::3DExtras Qt5::3DInput Qt5::3DAnimation)
|
||||
|
||||
# Generate every project-local CMVR message. This avoids source-tree generated
|
||||
# files and automatically picks up newly added configuration messages.
|
||||
file(GLOB_RECURSE PROTO_FILES CONFIGURE_DEPENDS
|
||||
"${PROTO_ROOT}/cmvr/api/*.proto"
|
||||
"${PROTO_ROOT}/cmvr/common/*.proto"
|
||||
"${PROTO_ROOT}/cmvr/config/*.proto"
|
||||
"${PROTO_ROOT}/cmvr/msgs/agv.proto"
|
||||
"${PROTO_ROOT}/cmvr/quic_edge/v1/*.proto")
|
||||
Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Multimedia
|
||||
Qt5::3DCore Qt5::3DRender Qt5::3DExtras Qt5::3DInput)
|
||||
|
||||
set(PROTO_NAMES
|
||||
cmvr/api/common
|
||||
cmvr/msgs/agv
|
||||
cmvr/api/agv_command
|
||||
cmvr/api/agv_service
|
||||
cmvr/api/arm_command
|
||||
cmvr/api/arm_service
|
||||
cmvr/api/biohead_command
|
||||
cmvr/api/biohead_service
|
||||
cmvr/api/camera_command
|
||||
cmvr/api/camera_service
|
||||
cmvr/api/configuration_command
|
||||
cmvr/api/configuration_service
|
||||
cmvr/api/dexhand_command
|
||||
cmvr/api/dexhand_service
|
||||
cmvr/api/hlc_command
|
||||
cmvr/api/hlc_service
|
||||
cmvr/api/microphone_command
|
||||
cmvr/api/microphone_service
|
||||
cmvr/api/speaker_command
|
||||
cmvr/api/speaker_service
|
||||
cmvr/api/system_command
|
||||
cmvr/api/system_service
|
||||
cmvr/api/test_service
|
||||
cmvr/quic_edge/v1/quic_edge)
|
||||
set(SERVICE_NAMES
|
||||
cmvr/api/motor_service
|
||||
cmvr/api/agv_service
|
||||
cmvr/api/arm_service
|
||||
cmvr/api/biohead_service
|
||||
cmvr/api/camera_service
|
||||
cmvr/api/configuration_service
|
||||
cmvr/api/dexhand_service
|
||||
cmvr/api/hlc_service
|
||||
cmvr/api/microphone_service
|
||||
@ -316,9 +119,8 @@ set(SERVICE_NAMES
|
||||
cmvr/api/test_service)
|
||||
|
||||
set(GENERATED_FILES)
|
||||
foreach(PROTO_FILE IN LISTS PROTO_FILES)
|
||||
file(RELATIVE_PATH PROTO_RELATIVE "${PROTO_ROOT}" "${PROTO_FILE}")
|
||||
string(REGEX REPLACE "\\.proto$" "" PROTO_NAME "${PROTO_RELATIVE}")
|
||||
foreach(PROTO_NAME IN LISTS PROTO_NAMES)
|
||||
set(PROTO_FILE "${PROTO_ROOT}/${PROTO_NAME}.proto")
|
||||
set(PB_CC "${GENERATED_ROOT}/${PROTO_NAME}.pb.cc")
|
||||
set(PB_H "${GENERATED_ROOT}/${PROTO_NAME}.pb.h")
|
||||
get_filename_component(PROTO_OUTPUT_DIR "${PB_CC}" DIRECTORY)
|
||||
@ -326,10 +128,10 @@ foreach(PROTO_FILE IN LISTS PROTO_FILES)
|
||||
OUTPUT "${PB_CC}" "${PB_H}"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${PROTO_OUTPUT_DIR}"
|
||||
COMMAND "${PROTOC}"
|
||||
"--proto_path=${PROTO_ROOT}"
|
||||
"--cpp_out=${GENERATED_ROOT}"
|
||||
--proto_path="${PROTO_ROOT}"
|
||||
--cpp_out="${GENERATED_ROOT}"
|
||||
"${PROTO_FILE}"
|
||||
DEPENDS "${PROTO_FILE}" ${PROTO_FILES}
|
||||
DEPENDS "${PROTO_FILE}" "${PROTOC}"
|
||||
VERBATIM)
|
||||
list(APPEND GENERATED_FILES "${PB_CC}" "${PB_H}")
|
||||
endforeach()
|
||||
@ -343,125 +145,55 @@ foreach(SERVICE_NAME IN LISTS SERVICE_NAMES)
|
||||
OUTPUT "${GRPC_CC}" "${GRPC_H}"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${PROTO_OUTPUT_DIR}"
|
||||
COMMAND "${PROTOC}"
|
||||
"--proto_path=${PROTO_ROOT}"
|
||||
"--grpc_out=${GENERATED_ROOT}"
|
||||
"--plugin=protoc-gen-grpc=${GRPC_CPP_PLUGIN}"
|
||||
--proto_path="${PROTO_ROOT}"
|
||||
--grpc_out="${GENERATED_ROOT}"
|
||||
--plugin=protoc-gen-grpc="${GRPC_CPP_PLUGIN}"
|
||||
"${PROTO_FILE}"
|
||||
DEPENDS "${PROTO_FILE}" ${PROTO_FILES}
|
||||
DEPENDS "${PROTO_FILE}" "${PROTOC}" "${GRPC_CPP_PLUGIN}"
|
||||
VERBATIM)
|
||||
list(APPEND GENERATED_FILES "${GRPC_CC}" "${GRPC_H}")
|
||||
endforeach()
|
||||
target_sources(CmvrControlStation PRIVATE ${GENERATED_FILES})
|
||||
|
||||
if(WIN32)
|
||||
file(GLOB ABSL_STATIC_LIBS "${CMVR_LIB_DIR}/libabsl_*.a")
|
||||
target_link_libraries(CmvrControlStation PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"${CMVR_LIB_DIR}/libgrpc++.a"
|
||||
"${CMVR_LIB_DIR}/libgrpc.a"
|
||||
"${CMVR_LIB_DIR}/libgpr.a"
|
||||
"${CMVR_LIB_DIR}/libaddress_sorting.a"
|
||||
"${CMVR_LIB_DIR}/libre2.a"
|
||||
"${CMVR_LIB_DIR}/libupb.a"
|
||||
"${CMVR_LIB_DIR}/libcares.a"
|
||||
"${CMVR_LIB_DIR}/libssl.a"
|
||||
"${CMVR_LIB_DIR}/libcrypto.a"
|
||||
"${CMVR_LIB_DIR}/libzlibstatic.a"
|
||||
"${CMVR_LIB_DIR}/libprotobuf.a"
|
||||
${ABSL_STATIC_LIBS}
|
||||
"-Wl,--end-group"
|
||||
"${CMVR_LIB_DIR}/libavcodec.dll.a"
|
||||
"${CMVR_LIB_DIR}/libavutil.dll.a"
|
||||
"${CMVR_LIB_DIR}/libswscale.dll.a"
|
||||
"${CMVR_LIB_DIR}/liburdfdom_model.dll.a"
|
||||
ws2_32 crypt32 advapi32 bcrypt dbghelp iphlpapi secur32 ntdll)
|
||||
else()
|
||||
if(CMVR_CXX_RUNTIME)
|
||||
target_link_libraries(CmvrControlStation PRIVATE "${CMVR_CXX_RUNTIME}")
|
||||
endif()
|
||||
target_link_libraries(CmvrControlStation PRIVATE
|
||||
protobuf::libprotobuf
|
||||
gRPC::grpc++
|
||||
PkgConfig::FFMPEG
|
||||
Threads::Threads
|
||||
"${CMVR_URDFDOM_MODEL_LIBRARY}")
|
||||
endif()
|
||||
file(GLOB ABSL_STATIC_LIBS "${CMVR_LIB_DIR}/libabsl_*.a")
|
||||
target_link_libraries(CmvrControlStation PRIVATE
|
||||
"-Wl,--start-group"
|
||||
"${CMVR_LIB_DIR}/libgrpc++.a"
|
||||
"${CMVR_LIB_DIR}/libgrpc.a"
|
||||
"${CMVR_LIB_DIR}/libgpr.a"
|
||||
"${CMVR_LIB_DIR}/libaddress_sorting.a"
|
||||
"${CMVR_LIB_DIR}/libre2.a"
|
||||
"${CMVR_LIB_DIR}/libupb.a"
|
||||
"${CMVR_LIB_DIR}/libcares.a"
|
||||
"${CMVR_LIB_DIR}/libssl.a"
|
||||
"${CMVR_LIB_DIR}/libcrypto.a"
|
||||
"${CMVR_LIB_DIR}/libzlibstatic.a"
|
||||
"${CMVR_LIB_DIR}/libprotobuf.a"
|
||||
${ABSL_STATIC_LIBS}
|
||||
"-Wl,--end-group"
|
||||
"${CMVR_LIB_DIR}/libavcodec.dll.a"
|
||||
"${CMVR_LIB_DIR}/libavutil.dll.a"
|
||||
"${CMVR_LIB_DIR}/libswscale.dll.a"
|
||||
"${CMVR_LIB_DIR}/liburdfdom_model.dll.a"
|
||||
ws2_32 crypt32 advapi32 bcrypt dbghelp iphlpapi secur32 ntdll)
|
||||
|
||||
if(WIN32)
|
||||
file(GLOB CMVR_RUNTIME_DLLS "${CMVR_LIB_DIR}/*.dll")
|
||||
foreach(RUNTIME_DLL IN LISTS CMVR_RUNTIME_DLLS)
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${RUNTIME_DLL}" "$<TARGET_FILE_DIR:CmvrControlStation>")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
foreach(CERTIFICATE IN ITEMS quic-test-server.pfx quic-test-ca.crt)
|
||||
if(EXISTS "${CMVR_CERT_DIR}/${CERTIFICATE}")
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMVR_CERT_DIR}/${CERTIFICATE}"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/${CERTIFICATE}")
|
||||
install(FILES "${CMVR_CERT_DIR}/${CERTIFICATE}" DESTINATION bin)
|
||||
endif()
|
||||
file(GLOB CMVR_RUNTIME_DLLS "${CMVR_LIB_DIR}/*.dll")
|
||||
foreach(RUNTIME_DLL IN LISTS CMVR_RUNTIME_DLLS)
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${RUNTIME_DLL}" "$<TARGET_FILE_DIR:CmvrControlStation>")
|
||||
endforeach()
|
||||
foreach(CERTIFICATE IN ITEMS quic-test-server.pfx quic-test-ca.crt)
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMVR_CERT_DIR}/${CERTIFICATE}"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/${CERTIFICATE}")
|
||||
endforeach()
|
||||
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/sceneparsers"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/models"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMVR_ASSIMP_SCENE_PARSER}"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/sceneparsers/"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/models"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/models")
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/models/demo_arm.urdf"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/models/demo_arm.urdf")
|
||||
|
||||
install(TARGETS CmvrControlStation RUNTIME DESTINATION bin)
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
"-DSOURCE=${CMAKE_CURRENT_SOURCE_DIR}/resources/application_settings.json"
|
||||
"-DDESTINATION=$<TARGET_FILE_DIR:CmvrControlStation>/data/application_settings.json"
|
||||
-P "${CMAKE_CURRENT_SOURCE_DIR}/cmake/SeedApplicationSettings.cmake"
|
||||
VERBATIM)
|
||||
install(CODE "
|
||||
set(SOURCE \"${CMAKE_CURRENT_SOURCE_DIR}/resources/application_settings.json\")
|
||||
set(DESTINATION \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/data/application_settings.json\")
|
||||
include(\"${CMAKE_CURRENT_SOURCE_DIR}/cmake/SeedApplicationSettings.cmake\")
|
||||
")
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:CmvrControlStation>/scripts"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/handeye_worker.py"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/handeye_math.py"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/scripts/handeye_refinement.py"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/scripts")
|
||||
install(FILES scripts/handeye_worker.py scripts/handeye_math.py scripts/handeye_refinement.py DESTINATION bin/scripts)
|
||||
if(WIN32)
|
||||
set(CMVR_HAND_EYE_JPEG_PLUGIN "${CMVR_QT_PLUGIN_ROOT}/imageformats/qjpeg$<$<CONFIG:Debug>:d>.dll")
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:CmvrControlStation>/imageformats"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMVR_HAND_EYE_JPEG_PLUGIN}"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/imageformats/")
|
||||
install(FILES "${CMVR_HAND_EYE_JPEG_PLUGIN}" DESTINATION bin/imageformats)
|
||||
set(CMVR_HAND_EYE_RUNTIME_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/handeye-runtime" CACHE PATH "Bundled Windows x64 hand-eye runtime")
|
||||
if(NOT EXISTS "${CMVR_HAND_EYE_RUNTIME_DIR}/manifest.json")
|
||||
message(FATAL_ERROR "Build the bundled runtime with scripts/package_handeye_runtime.py first")
|
||||
endif()
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:CmvrControlStation>/runtime/handeye"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMVR_HAND_EYE_RUNTIME_DIR}"
|
||||
"$<TARGET_FILE_DIR:CmvrControlStation>/runtime/handeye")
|
||||
install(DIRECTORY "${CMVR_HAND_EYE_RUNTIME_DIR}/" DESTINATION bin/runtime/handeye)
|
||||
endif()
|
||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/models/"
|
||||
DESTINATION bin/models)
|
||||
install(PROGRAMS "${CMVR_ASSIMP_SCENE_PARSER}"
|
||||
DESTINATION bin/sceneparsers)
|
||||
|
||||
if(WIN32 AND MINGW)
|
||||
add_custom_command(TARGET CmvrControlStation POST_BUILD
|
||||
COMMAND powershell.exe -NoProfile -ExecutionPolicy RemoteSigned
|
||||
-File "${CMAKE_CURRENT_SOURCE_DIR}/scripts/repair_qt3d_release.ps1"
|
||||
-RuntimeDirectory "$<TARGET_FILE_DIR:CmvrControlStation>" -IfPresent
|
||||
VERBATIM)
|
||||
endif()
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
QT += core gui widgets svg network multimedia 3dcore 3drender 3dextras 3dinput 3danimation
|
||||
QT += core gui widgets multimedia 3dcore 3drender 3dextras 3dinput
|
||||
|
||||
CONFIG += c++17 warn_on debug_and_release
|
||||
win32-g++: QMAKE_CXXFLAGS += -Wa,-mbig-obj
|
||||
CONFIG += c++14 warn_on debug_and_release
|
||||
TEMPLATE = app
|
||||
|
||||
DEFINES += QT_DEPRECATED_WARNINGS _WIN32_WINNT=0x0600
|
||||
@ -18,7 +17,7 @@ MSQUIC_DLL = $$LIB_DIR/msquic.dll
|
||||
MSQUIC_TEST_CERT = $$CERT_DIR/quic-test-server.pfx
|
||||
MSQUIC_TEST_CA = $$CERT_DIR/quic-test-ca.crt
|
||||
RUNTIME_DLLS = $$files($$LIB_DIR/*.dll)
|
||||
MODEL_DIR = $$clean_path($$PWD/models)
|
||||
DEMO_URDF = $$clean_path($$PWD/models/demo_arm.urdf)
|
||||
QT_SCENEPARSER_DIR = $$clean_path($$[QT_INSTALL_PLUGINS]/sceneparsers)
|
||||
|
||||
!exists($$PROTOC): error("protoc launcher not found. Run scripts/build_native_deps.ps1 first.")
|
||||
@ -33,17 +32,17 @@ QT_SCENEPARSER_DIR = $$clean_path($$[QT_INSTALL_PLUGINS]/sceneparsers)
|
||||
!exists($$LIB_DIR/liburdfdom_model.dll): error("urdfdom runtime DLL not found in lib.")
|
||||
|
||||
PROTO_FILES = \
|
||||
$$PROTO_ROOT/cmvr/api/motor_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/common.proto \
|
||||
$$PROTO_ROOT/cmvr/api/agv_command.proto \
|
||||
$$PROTO_ROOT/cmvr/api/agv_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/arm_command.proto \
|
||||
$$PROTO_ROOT/cmvr/api/arm_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/biohead_command.proto \
|
||||
$$PROTO_ROOT/cmvr/api/head_joint_command.proto \
|
||||
$$PROTO_ROOT/cmvr/api/biohead_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/camera_command.proto \
|
||||
$$PROTO_ROOT/cmvr/api/camera_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/configuration_command.proto \
|
||||
$$PROTO_ROOT/cmvr/api/configuration_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/dexhand_command.proto \
|
||||
$$PROTO_ROOT/cmvr/api/dexhand_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/hlc_command.proto \
|
||||
@ -57,11 +56,11 @@ PROTO_FILES = \
|
||||
$$PROTO_ROOT/cmvr/api/test_service.proto
|
||||
|
||||
GRPC_PROTO_FILES = \
|
||||
$$PROTO_ROOT/cmvr/api/motor_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/agv_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/arm_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/biohead_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/camera_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/configuration_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/dexhand_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/hlc_service.proto \
|
||||
$$PROTO_ROOT/cmvr/api/microphone_service.proto \
|
||||
@ -88,13 +87,10 @@ CONFIG_PROTO_FILES = \
|
||||
$$PROTO_ROOT/cmvr/config/quic_edge_config/quic_edge_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/self_collision_task_config/self_collision_task_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/speaker_config/speaker_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/touch_config/touch_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/task_manager_config/task_manager_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/touch_screen_task_config/touch_screen_task_config.proto
|
||||
|
||||
CONFIG_ROOT_PROTO_FILES = \
|
||||
$$PROTO_ROOT/cmvr/config/collision_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/joint_motion_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/cartesian_motion_validation_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/joint_limits_config.proto \
|
||||
$$PROTO_ROOT/cmvr/config/lawba_ik_config.proto \
|
||||
@ -114,7 +110,7 @@ QUIC_PROTO_FILES = \
|
||||
$$PROTO_ROOT/cmvr/quic_edge/v1/quic_edge.proto
|
||||
|
||||
# Show the complete local proto tree in Qt Creator without compiling unused APIs.
|
||||
OTHER_FILES += $$files($$PROTO_ROOT/*.proto, true) $$files($$MODEL_DIR/*.urdf, true)
|
||||
OTHER_FILES += $$files($$PROTO_ROOT/*.proto, true) $$DEMO_URDF
|
||||
|
||||
INCLUDEPATH += \
|
||||
$$PROTO_GEN_DIR \
|
||||
@ -140,7 +136,7 @@ msg_protobuf_compiler.CONFIG += target_predeps
|
||||
config_protobuf_compiler.name = Protobuf ${QMAKE_FILE_IN}
|
||||
config_protobuf_compiler.input = CONFIG_PROTO_FILES
|
||||
config_protobuf_compiler.output = $$PROTO_GEN_DIR/cmvr/config/${QMAKE_FILE_BASE}/${QMAKE_FILE_BASE}.pb.cc
|
||||
config_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PROTO_ROOT/cmvr/config/${QMAKE_FILE_BASE}/${QMAKE_FILE_BASE}.proto)
|
||||
config_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PWD/${QMAKE_FILE_IN})
|
||||
config_protobuf_compiler.depends = $$CONFIG_PROTO_FILES
|
||||
config_protobuf_compiler.variable_out = SOURCES
|
||||
config_protobuf_compiler.CONFIG += target_predeps
|
||||
@ -148,7 +144,7 @@ config_protobuf_compiler.CONFIG += target_predeps
|
||||
config_root_protobuf_compiler.name = Protobuf ${QMAKE_FILE_IN}
|
||||
config_root_protobuf_compiler.input = CONFIG_ROOT_PROTO_FILES
|
||||
config_root_protobuf_compiler.output = $$PROTO_GEN_DIR/cmvr/config/${QMAKE_FILE_BASE}.pb.cc
|
||||
config_root_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PROTO_ROOT/cmvr/config/${QMAKE_FILE_BASE}.proto)
|
||||
config_root_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PWD/${QMAKE_FILE_IN})
|
||||
config_root_protobuf_compiler.depends = $$CONFIG_ROOT_PROTO_FILES $$COMMON_PROTO_FILES
|
||||
config_root_protobuf_compiler.variable_out = SOURCES
|
||||
config_root_protobuf_compiler.CONFIG += target_predeps
|
||||
@ -156,7 +152,7 @@ config_root_protobuf_compiler.CONFIG += target_predeps
|
||||
common_protobuf_compiler.name = Protobuf ${QMAKE_FILE_IN}
|
||||
common_protobuf_compiler.input = COMMON_PROTO_FILES
|
||||
common_protobuf_compiler.output = $$PROTO_GEN_DIR/cmvr/common/${QMAKE_FILE_BASE}.pb.cc
|
||||
common_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PROTO_ROOT/cmvr/common/${QMAKE_FILE_BASE}.proto)
|
||||
common_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PWD/${QMAKE_FILE_IN})
|
||||
common_protobuf_compiler.depends = $$COMMON_PROTO_FILES
|
||||
common_protobuf_compiler.variable_out = SOURCES
|
||||
common_protobuf_compiler.CONFIG += target_predeps
|
||||
@ -164,7 +160,7 @@ common_protobuf_compiler.CONFIG += target_predeps
|
||||
mujoco_protobuf_compiler.name = Protobuf ${QMAKE_FILE_IN}
|
||||
mujoco_protobuf_compiler.input = MUJOCO_PROTO_FILES
|
||||
mujoco_protobuf_compiler.output = $$PROTO_GEN_DIR/cmvr/config/mujoco_config/${QMAKE_FILE_BASE}.pb.cc
|
||||
mujoco_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PROTO_ROOT/cmvr/config/mujoco_config/${QMAKE_FILE_BASE}.proto)
|
||||
mujoco_protobuf_compiler.commands = $$quote($$PROTOC) --proto_path=$$quote($$PROTO_ROOT) --cpp_out=$$quote($$PROTO_GEN_DIR) $$quote($$PWD/${QMAKE_FILE_IN})
|
||||
mujoco_protobuf_compiler.depends = $$MUJOCO_PROTO_FILES
|
||||
mujoco_protobuf_compiler.variable_out = SOURCES
|
||||
mujoco_protobuf_compiler.CONFIG += target_predeps
|
||||
@ -216,7 +212,7 @@ LIBS += \
|
||||
-lsecur32 \
|
||||
-lntdll
|
||||
|
||||
DEFINES += CMVR_WITH_GRPC=1 CMVR_WITH_MSQUIC=1
|
||||
DEFINES += CMVR_WITH_GRPC=1
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
TARGET = CmvrControlStation_d
|
||||
@ -241,37 +237,14 @@ CONFIG(debug, debug|release) {
|
||||
!exists($$ASSIMP_SCENE_PARSER): error("Qt3D Assimp scene parser not found in the selected Qt Kit.")
|
||||
|
||||
SOURCES += \
|
||||
src/bioheadexpressionstore.cpp \
|
||||
src/bioheadjointclient.cpp \
|
||||
src/seeragvmapclient.cpp \
|
||||
src/agvmapdocument.cpp \
|
||||
src/agvmaprasterizer.cpp \
|
||||
src/agvmapeditorwidget.cpp \
|
||||
src/applicationsettings.cpp \
|
||||
src/applicationstyle.cpp \
|
||||
src/taskorchestrationwidget.cpp \
|
||||
src/handeyebridge.cpp \
|
||||
src/handeyestore.cpp \
|
||||
src/handeyeurdf.cpp \
|
||||
src/touchplanner.cpp \
|
||||
src/touchsequencecontroller.cpp \
|
||||
src/touchvideowidget.cpp \
|
||||
src/touchoperationwidget.cpp \
|
||||
src/handeyemotionwidget.cpp \
|
||||
src/tcpcalibration.cpp \
|
||||
src/tcpjogcontroller.cpp \
|
||||
src/tcptoolstore.cpp \
|
||||
src/tcpcalibrationwidget.cpp \
|
||||
src/agvmapviewwidget.cpp \
|
||||
src/audiostreammanager.cpp \
|
||||
src/configeditorwidget.cpp \
|
||||
src/main.cpp \
|
||||
src/mainwindow.cpp \
|
||||
src/mainwindow_ui.cpp \
|
||||
src/quictestserver.cpp \
|
||||
src/rpcservicewidget.cpp \
|
||||
src/robotclient.cpp \
|
||||
src/tactileheatmapwidget.cpp \
|
||||
src/jointfloweditor.cpp \
|
||||
src/trendwidget.cpp \
|
||||
src/urdfviewerwidget.cpp \
|
||||
src/videodecoder.cpp \
|
||||
@ -279,44 +252,16 @@ SOURCES += \
|
||||
ui/handeyecalibrationwidget.cpp
|
||||
|
||||
HEADERS += \
|
||||
src/bioheadexpressionstore.h \
|
||||
src/bioheadjointclient.h \
|
||||
src/agvvelocityramp.h \
|
||||
src/seeragvmapclient.h \
|
||||
src/agvmapdocument.h \
|
||||
src/agvmaprasterizer.h \
|
||||
src/agvmapeditorwidget.h \
|
||||
src/applicationsettings.h \
|
||||
src/applicationstyle.h \
|
||||
src/appmessagebox.h \
|
||||
src/taskorchestrationwidget.h \
|
||||
src/handeyebridge.h \
|
||||
src/handeyeprocessworker.h \
|
||||
src/handeyestore.h \
|
||||
src/handeyeurdf.h \
|
||||
src/touchplanner.h \
|
||||
src/touchsequencecontroller.h \
|
||||
src/touchvideowidget.h \
|
||||
src/touchoperationwidget.h \
|
||||
src/handeyemotionwidget.h \
|
||||
src/tcpcalibration.h \
|
||||
src/tcpjogcontroller.h \
|
||||
src/tcptoolstore.h \
|
||||
src/tcpcalibrationwidget.h \
|
||||
src/agvmapviewwidget.h \
|
||||
src/audiostreammanager.h \
|
||||
src/configeditorwidget.h \
|
||||
src/mainwindow.h \
|
||||
src/quictestserver.h \
|
||||
src/rpcservicewidget.h \
|
||||
src/robotclient.h \
|
||||
src/tactileheatmapwidget.h \
|
||||
src/jointfloweditor.h \
|
||||
src/trendwidget.h \
|
||||
src/uiicons.h \
|
||||
src/urdfviewerwidget.h \
|
||||
src/videodecoder.h \
|
||||
src/camerasnapshotdecoder.h \
|
||||
src/snapshotimageview.h \
|
||||
src/videoframe.h \
|
||||
src/videorenderwidget.h \
|
||||
ui/handeyecalibrationwidget.h
|
||||
@ -342,82 +287,15 @@ quic_certificate_deployment.files = $$MSQUIC_TEST_CERT
|
||||
quic_certificate_deployment.path = $$DESTDIR
|
||||
quic_ca_deployment.files = $$MSQUIC_TEST_CA
|
||||
quic_ca_deployment.path = $$DESTDIR
|
||||
demo_urdf_deployment.files = $$DEMO_URDF
|
||||
demo_urdf_deployment.path = $$DESTDIR/models
|
||||
assimp_scene_parser_deployment.files = $$ASSIMP_SCENE_PARSER
|
||||
assimp_scene_parser_deployment.path = $$DESTDIR/sceneparsers
|
||||
COPIES += runtime_library_deployment quic_certificate_deployment quic_ca_deployment assimp_scene_parser_deployment
|
||||
handeye_algorithm_deployment.files = $$PWD/scripts/handeye_worker.py $$PWD/scripts/handeye_math.py $$PWD/scripts/handeye_refinement.py
|
||||
handeye_algorithm_deployment.path = $$DESTDIR/scripts
|
||||
COPIES += handeye_algorithm_deployment
|
||||
win32 {
|
||||
CONFIG(debug, debug|release): HAND_EYE_JPEG_PLUGIN = $$[QT_INSTALL_PLUGINS]/imageformats/qjpegd.dll
|
||||
else: HAND_EYE_JPEG_PLUGIN = $$[QT_INSTALL_PLUGINS]/imageformats/qjpeg.dll
|
||||
handeye_image_plugin.files = $$HAND_EYE_JPEG_PLUGIN
|
||||
handeye_image_plugin.path = $$DESTDIR/imageformats
|
||||
COPIES += handeye_image_plugin
|
||||
}
|
||||
DISTFILES += scripts/handeye_worker.py scripts/handeye_math.py scripts/handeye_refinement.py
|
||||
DISTFILES += scripts/package_handeye_runtime.py
|
||||
DISTFILES += resources/application_settings.json cmake/SeedApplicationSettings.cmake
|
||||
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY_DIR $$shell_quote($$shell_path($$MODEL_DIR)) $$shell_quote($$shell_path($$DESTDIR/models))
|
||||
COPIES += runtime_library_deployment quic_certificate_deployment quic_ca_deployment demo_urdf_deployment assimp_scene_parser_deployment
|
||||
|
||||
win32 {
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) if not exist $$shell_quote($$shell_path($$DESTDIR/data)) $$QMAKE_MKDIR $$shell_quote($$shell_path($$DESTDIR/data))
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) if not exist $$shell_quote($$shell_path($$DESTDIR/data/application_settings.json)) $$QMAKE_COPY_FILE $$shell_quote($$shell_path($$PWD/resources/application_settings.json)) $$shell_quote($$shell_path($$DESTDIR/data/application_settings.json))
|
||||
} else {
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) $$QMAKE_MKDIR $$shell_quote($$DESTDIR/data)
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) test -e $$shell_quote($$DESTDIR/data/application_settings.json) || $$QMAKE_COPY_FILE $$shell_quote($$PWD/resources/application_settings.json) $$shell_quote($$DESTDIR/data/application_settings.json)
|
||||
}
|
||||
|
||||
win32 {
|
||||
isEmpty(HAND_EYE_RUNTIME_DIR): HAND_EYE_RUNTIME_DIR = $$PWD/third_party/handeye-runtime
|
||||
!exists($$HAND_EYE_RUNTIME_DIR/manifest.json): error(Build the bundled runtime with scripts/package_handeye_runtime.py first)
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) if not exist $$shell_quote($$shell_path($$DESTDIR/runtime)) $$QMAKE_MKDIR $$shell_quote($$shell_path($$DESTDIR/runtime))
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) $$QMAKE_COPY_DIR $$shell_quote($$shell_path($$HAND_EYE_RUNTIME_DIR)) $$shell_quote($$shell_path($$DESTDIR/runtime/handeye))
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) $$QMAKE_COPY_FILE $$shell_quote($$shell_path($$MSQUIC_TEST_CERT)) $$shell_quote($$shell_path($$DESTDIR/quic-test-server.pfx))
|
||||
QMAKE_POST_LINK += $$QMAKE_COPY_FILE $$shell_quote($$shell_path($$MSQUIC_TEST_CERT)) $$shell_quote($$shell_path($$DESTDIR/quic-test-server.pfx))
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) $$QMAKE_COPY_FILE $$shell_quote($$shell_path($$MSQUIC_TEST_CA)) $$shell_quote($$shell_path($$DESTDIR/quic-test-ca.crt))
|
||||
}
|
||||
|
||||
win32:RC_ICONS = icons/cmvr-app.ico
|
||||
|
||||
HEADERS += src/calibrationfile.h
|
||||
|
||||
SOURCES += src/touchplanestore.cpp
|
||||
HEADERS += src/touchplanestore.h src/cameracapabilities.h src/bioheadoperations.h
|
||||
SOURCES += src/bioheadwidget.cpp
|
||||
HEADERS += src/bioheadwidget.h src/jointpointdata.h src/motordebugwidget.h
|
||||
SOURCES += src/motordebugwidget.cpp src/motorplot.cpp
|
||||
HEADERS += src/motorplot.h
|
||||
SOURCES += src/usercoordinatewidget.cpp
|
||||
HEADERS += src/usercoordinatewidget.h src/usercoordinatestore.h
|
||||
|
||||
SOURCES += src/actionqueuetestwidget.cpp
|
||||
HEADERS += src/actionqueuetestwidget.h
|
||||
|
||||
SOURCES += src/taskapi.cpp src/taskprotoeditor.cpp src/taskrpcrunner.cpp
|
||||
HEADERS += src/taskapi.h src/taskprotoeditor.h src/taskrpcrunner.h
|
||||
|
||||
HEADERS += src/taskjointeditor.h src/taskuilabels.h
|
||||
|
||||
SOURCES += src/taskdeviceoptions.cpp
|
||||
HEADERS += src/taskdeviceoptions.h
|
||||
|
||||
SOURCES += src/demosimulator.cpp
|
||||
HEADERS += src/demosimulator.h
|
||||
HEADERS += src/workflowcanvas.h
|
||||
SOURCES += src/freescaninterop.cpp
|
||||
HEADERS += src/freescaninterop.h
|
||||
|
||||
# Release diagnostics retain optimization and source line information.
|
||||
QMAKE_CXXFLAGS_RELEASE += -g1
|
||||
QMAKE_LFLAGS_RELEASE -= -Wl,-s
|
||||
win32: QMAKE_LFLAGS_RELEASE += -Wl,-Map,bin/release/CmvrControlStation.map
|
||||
|
||||
win32:CONFIG(release, debug|release) {
|
||||
QMAKE_POST_LINK += $$escape_expand(\n\t) powershell.exe -NoProfile -ExecutionPolicy RemoteSigned -File $$shell_quote($$shell_path($$PWD/scripts/repair_qt3d_release.ps1)) -RuntimeDirectory $$shell_quote($$shell_path($$DESTDIR)) -IfPresent
|
||||
}
|
||||
DISTFILES += scripts/repair_qt3d_release.ps1
|
||||
|
||||
HEADERS += src/workflowgraph.h src/freescaninteropui.h
|
||||
HEADERS += src/workflowruntime.h
|
||||
HEADERS += src/workflowhistory.h src/workflowrobotmanager.h
|
||||
win32:RC_ICONS =
|
||||
|
||||
336
README.md
336
README.md
@ -1,336 +0,0 @@
|
||||
# CMVR Control Station
|
||||
|
||||
CMVR Control Station 是一个基于 Qt 5 的桌面控制站,用于连接 CMVR 机器人边缘服务。应用通过 gRPC 调用系统、机械臂、相机、AGV、音频、灵巧手和仿生头等服务,并提供视频预览、音频收发、URDF 模型查看、配置编辑和 QUIC 边缘节点测试服务。
|
||||
|
||||
## 主要功能
|
||||
|
||||
- 连接真实 gRPC 服务或使用内置 Demo 模式离线体验界面
|
||||
- 系统状态、机械臂、AGV、相机及其他设备服务控制
|
||||
- H.264/H.265 视频解码和 OpenGL 视频渲染
|
||||
- 麦克风采集、扬声器播放和流式音频
|
||||
- 内置 AUBO、Elfin、小研及自定义 URDF 模型选择与 Qt3D 显示
|
||||
- Protobuf 配置查看、校验和编辑
|
||||
- 可选的 MsQuic/TLS 测试服务器
|
||||
|
||||
## 设备连接与控制
|
||||
|
||||
### AGV 手动加减速
|
||||
|
||||
AGV 页右侧“手动控制”可分别设置线加速度、线减速度(m/s²),以及角加速度、角减速度(rad/s²)。默认分别为 0.20、0.30、0.50、0.80,修改后自动保存到本机。X/Y/Z 速度输入仍表示目标速度,按住方向按钮或 Q/W/E/A/S/D 键时逐步接近目标;换向先减至零,再向新方向加速。
|
||||
|
||||
松开按键、点击手动区“停止”或“速度归零”会按设置减速,减速期间车辆仍有移动距离。右侧“停止速度”和“AGV 急停”沿用立即停止请求;失焦、离开手动页面、设备/连接变化及地图直连操作也会取消斜坡。手动速度最多保留一个在途请求,过期请求丢弃,失败或响应超时后停止继续发送速度,须重新按键才能启动。此功能只修改上位机,不修改控制器参数、服务端或接口定义。
|
||||
|
||||
### AGV 地图直连
|
||||
|
||||
AGV 的地图工作区可选择“通过服务”或“车辆直连”。该选项只改变地图读取、保存和切图的上位机通信路径,不修改服务端或 gRPC/proto 定义;Demo 模式继续使用演示数据。导航、状态、建图和其他设备仍使用原有服务。
|
||||
|
||||
车辆直连需要手动填写车辆 IP,使用标准端口 19204/19205/19207。车辆 TCP 操作在独立线程执行,不占用原有控制请求线程。
|
||||
|
||||
直连保存发送包含顶层 `header` 的完整原始 SMAP,保留未知字段和数字文本。写入前读取最新地图供编辑器合并,并检查车辆速度和导航状态;静止且任务空闲才申请控制权、再次检查状态并发送一次地图请求。切图须同时读取到加载成功和当前地图名称匹配才显示完成。发送后超时、取消或回包异常会显示结果未知,不自动重发;原编辑内容仍保留。直连操作期间,本窗口的导航、运动和建图入口暂时禁用,急停与停止入口保持可用。
|
||||
|
||||
该路径要求本机能访问车辆网络,不会修复服务端持有的断开连接。服务状态与直连切图确认分别显示。实车操作前应确保没有其他控制端同时发起导航或修改地图;本机模拟 TCP 测试通过并不等同于实车保存成功。
|
||||
|
||||
## 机械臂自动识别与切换
|
||||
|
||||
机械臂页面的顶部选单来自 `GetSystemStatus` 返回的全部在线机械臂,不再使用
|
||||
固定的“左臂/右臂”选项。切换该选单后,
|
||||
上位机会以相同的 `device_id` 调用 `ArmService.GetArmInfo` 和
|
||||
`ArmService.getRobotState`:
|
||||
|
||||
- `GetArmInfo` 返回厂商、SDK 检测到的精确型号/子型号、自由度、关节名以及默认
|
||||
Base/TCP 坐标系。AUBO 使用 `getRobotType/getRobotSubType`,华沿使用
|
||||
`HRIF_ReadRobotModel`;SDK 查询失败时边缘端回退到配置文件中的型号。
|
||||
- 关节点动区、零位标定关节列表和实时关节表按返回的自由度与关节名动态生成,
|
||||
不再假定机械臂固定为 7 轴。
|
||||
- 上位机按厂商、型号和子型号自动选择内置 URDF。驱动关节名与 URDF 关节名不一致
|
||||
时,按 SDK/URDF 的关节顺序映射实时姿态和示教姿态。
|
||||
- `getRobotState` 一次返回运行模式、安全状态、使能/故障状态、关节状态和 TCP
|
||||
位姿,切换设备时响应会按 `device_id` 校验,避免旧设备的在途响应覆盖新设备。
|
||||
|
||||
上述功能需要 cmvr-es `061bfc50` 或更高版本。
|
||||
|
||||
### 机械臂点动与实时状态
|
||||
|
||||
“模型与控制”页将 URDF 模型、速度点动和只读遥测放在同一工作区:
|
||||
|
||||
- “关节速度”按实时自由度生成每个关节的当前位置与 `−/+` 按钮。每条位置条
|
||||
使用当前精确 URDF 的关节上下限映射实时位置;按住按钮时调用 `speedJ`,速度
|
||||
为左侧 SpeedJ 最大速度乘以速度倍率,松开按钮立即调用 `stopMotion`。
|
||||
- “笛卡尔速度”显示当前 X/Y/Z、RX/RY/RZ,并使用相同的按住点动交互调用
|
||||
`speedL`。SpeedL 使用独立的笛卡尔速度(m/s)和加速度(m/s²)限制,不再
|
||||
复用 SpeedJ 的关节单位参数。基座坐标和工具坐标名称通过 `ListBaseFrame`、`ListTCPFrame` 自动
|
||||
获取;选择变化后,遥测通过 `getPose(base_link, ee_link)` 显示对应坐标对的
|
||||
末端位姿。
|
||||
- 当前 cmvr-es 的 `speedL` 协议只接受 Base/Tool 类型,不接受命名坐标系。
|
||||
因此点动命令按 Base 语义发送,坐标名称用于选定实时位姿的参考基座和 TCP;
|
||||
后续若需要在任意命名坐标系轴向点动,需要扩展 `SpeedL.Request` 及边缘端驱动。
|
||||
- 下方“实时状态”只读显示关节位置、速度、由连续速度采样计算的加速度,以及
|
||||
当前坐标对下的末端位置姿态;关节与末端两个状态区域等宽显示,不再提供
|
||||
MoveJ/MoveL 目标输入和示教按钮。
|
||||
|
||||
## 技术栈和目录
|
||||
|
||||
项目使用 C++14、Qt 5、gRPC/Protobuf、FFmpeg、urdfdom 和可选的 MsQuic。
|
||||
|
||||
```text
|
||||
src/ 应用、服务客户端、音视频和三维显示源码
|
||||
ui/ Qt Designer 界面文件和辅助控件
|
||||
protos/ CMVR gRPC、配置和 QUIC 协议定义
|
||||
models/ 内置机械臂 URDF、网格资源与来源说明
|
||||
certs/ QUIC 测试 CA;本机 PFX 证书不提交到 Git
|
||||
include/, lib/ Windows MinGW 预编译依赖
|
||||
tools/ Windows protoc 和 grpc_cpp_plugin
|
||||
scripts/ Windows 依赖、构建脚本和 Linux 构建入口
|
||||
```
|
||||
|
||||
CMake 是 Windows 和 Linux 的统一构建入口。`CmvrControlStation.pro` 继续保留,用于现有 Windows Qt Creator/qmake 工作流。
|
||||
|
||||
## Linux 编译
|
||||
|
||||
麒麟 Linux x86 可先使用一键安装脚本(采用当前系统已配置的软件源):
|
||||
|
||||
```bash
|
||||
bash scripts/setup_kylin.sh --source "$PWD"
|
||||
```
|
||||
|
||||
仅安装 Qt 与依赖时去掉 `--source "$PWD"`;仅检查时使用 `--check`。如需 Qt Creator,追加 `--with-qtcreator`。脚本支持 APT、DNF/YUM,安装后会验证 Qt5、CMake、gRPC/Protobuf、音视频、模型插件及共享库;缺少必需包会明确失败。它不添加外部仓库,不启动上位机或控制设备。详见 [麒麟脚本使用说明](scripts/setup_kylin_使用说明.txt)。
|
||||
|
||||
### 1. 安装依赖
|
||||
|
||||
Debian/Ubuntu 示例:
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install \
|
||||
build-essential cmake ninja-build pkg-config \
|
||||
qtbase5-dev qtmultimedia5-dev qt3d5-dev qt3d-assimpsceneimport-plugin \
|
||||
libprotobuf-dev protobuf-compiler protobuf-compiler-grpc \
|
||||
libgrpc++-dev \
|
||||
libavcodec-dev libavutil-dev libswscale-dev \
|
||||
liburdfdom-dev libtinyxml-dev libassimp-dev libgl1-mesa-dev
|
||||
```
|
||||
|
||||
不同发行版的包名可能不同,但需要提供以下 CMake/pkg-config 组件:
|
||||
|
||||
- Qt 5.12 或更高版本:Core、Gui、Widgets、Multimedia、3DCore、3DRender、3DExtras、3DInput
|
||||
- Protobuf 和 `protoc`
|
||||
- gRPC C++ 和 `grpc_cpp_plugin`
|
||||
- FFmpeg:libavcodec、libavutil、libswscale
|
||||
- urdfdom、Assimp 和 OpenGL
|
||||
|
||||
### 2. 编译默认版本
|
||||
|
||||
Linux 默认关闭内置 MsQuic 服务,其余功能可正常编译:
|
||||
|
||||
```bash
|
||||
bash scripts/build_demo.sh Release
|
||||
```
|
||||
|
||||
等价的手动命令:
|
||||
|
||||
```bash
|
||||
cmake -S . -B build/linux-release -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMVR_WITH_MSQUIC=OFF
|
||||
cmake --build build/linux-release --parallel
|
||||
```
|
||||
|
||||
输出程序:
|
||||
|
||||
```text
|
||||
bin/release/CmvrControlStation
|
||||
```
|
||||
|
||||
Debug 构建:
|
||||
|
||||
```bash
|
||||
bash scripts/build_demo.sh Debug
|
||||
```
|
||||
|
||||
### 3. 启用 Linux MsQuic
|
||||
|
||||
安装包含 `msquic.h`、`msquic_posix.h` 和 `libmsquic.so` 的 Linux MsQuic 开发包,然后配置:
|
||||
|
||||
```bash
|
||||
cmake -S . -B build/linux-release -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMVR_WITH_MSQUIC=ON \
|
||||
-DCMVR_MSQUIC_ROOT=/opt/msquic
|
||||
cmake --build build/linux-release --parallel
|
||||
```
|
||||
|
||||
如果 MsQuic 安装在系统标准目录,可以省略 `CMVR_MSQUIC_ROOT`。运行时动态链接器必须能够找到 `libmsquic.so`。
|
||||
|
||||
QUIC 服务使用 PKCS#12 证书。将 `quic-test-server.pfx` 放入 `certs/` 后重新构建,CMake 会把它复制到程序目录。默认测试密码为 `cmvr-test`。
|
||||
|
||||
### 4. 运行
|
||||
|
||||
```bash
|
||||
./bin/release/CmvrControlStation
|
||||
```
|
||||
|
||||
如果使用非系统 Qt 或其他自定义依赖前缀,通过 `CMAKE_PREFIX_PATH` 指定:
|
||||
|
||||
```bash
|
||||
cmake -S . -B build/linux-release -G Ninja \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_PREFIX_PATH="/opt/qt5;/opt/grpc;/opt/urdfdom"
|
||||
```
|
||||
|
||||
Qt Multimedia 在 Linux 上依赖系统音频/媒体后端;如果音频文件不能解码,请安装发行版提供的 GStreamer 插件。URDF 中的外部网格由 Qt3D Assimp scene parser 加载。
|
||||
|
||||
## Windows 编译
|
||||
|
||||
Windows 仓库内的静态库使用固定 ABI:
|
||||
|
||||
- Qt 5.12.4 MinGW 64-bit
|
||||
- MinGW 7.3 64-bit
|
||||
- gRPC 1.48.4 / Protobuf 3.19.5
|
||||
- FFmpeg 4.4.5
|
||||
- MsQuic 2.5.9 OpenSSL x64
|
||||
- urdfdom 4.0.3
|
||||
|
||||
不要混用 MSVC、32 位 Qt 或其他 MinGW ABI。详细依赖说明见 [NATIVE_DEPS.md](NATIVE_DEPS.md)。
|
||||
|
||||
### 1. 准备 Qt 和证书
|
||||
|
||||
默认目录:
|
||||
|
||||
```text
|
||||
C:\Qt\Qt5.12.4\5.12.4\mingw73_64
|
||||
C:\Qt\Qt5.12.4\Tools\mingw730_64
|
||||
```
|
||||
|
||||
`certs/quic-test-server.pfx` 含有私钥,因此被 Git 忽略。可以从开发环境安全复制,或生成新的测试证书:
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass `
|
||||
-File .\scripts\install_msquic.ps1 `
|
||||
-ServerIp 192.168.0.118
|
||||
|
||||
Copy-Item `
|
||||
.\third_party\install\msquic\certs\quic-test-server.pfx `
|
||||
.\certs\
|
||||
Copy-Item `
|
||||
.\third_party\install\msquic\certs\quic-test-ca.crt `
|
||||
.\certs\ `
|
||||
-Force
|
||||
```
|
||||
|
||||
将示例 IP 替换为运行控制站电脑的地址。
|
||||
|
||||
### 2. 使用 CMake 编译
|
||||
|
||||
在 PowerShell 中:
|
||||
|
||||
```powershell
|
||||
$QtRoot = "C:\Qt\Qt5.12.4"
|
||||
$env:Path = "$QtRoot\5.12.4\mingw73_64\bin;$QtRoot\Tools\mingw730_64\bin;$env:Path"
|
||||
|
||||
cmake -S . -B build\windows-release -G "MinGW Makefiles" `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DCMAKE_PREFIX_PATH="$QtRoot\5.12.4\mingw73_64" `
|
||||
-DCMVR_WITH_MSQUIC=ON
|
||||
|
||||
cmake --build build\windows-release --parallel 4
|
||||
```
|
||||
|
||||
输出程序:
|
||||
|
||||
```text
|
||||
bin\release\CmvrControlStation.exe
|
||||
```
|
||||
|
||||
CMake 会复制仓库 `lib/` 中的运行时 DLL、现有证书和完整 `models/` 模型目录。制作独立安装包时,仍需执行 Qt 的 `windeployqt` 复制 Qt DLL 和插件。
|
||||
|
||||
### 3. 使用现有 qmake 脚本
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass `
|
||||
-File .\scripts\build_demo.ps1 `
|
||||
-Configuration release
|
||||
```
|
||||
|
||||
Debug:
|
||||
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass `
|
||||
-File .\scripts\build_demo.ps1 `
|
||||
-Configuration debug
|
||||
```
|
||||
|
||||
也可以在 Qt Creator 中打开 `CmvrControlStation.pro`,选择 `Desktop Qt 5.12.4 MinGW 64-bit` Kit,运行 qmake 后构建。
|
||||
|
||||
## CMake 选项
|
||||
|
||||
| 选项 | Windows 默认值 | Linux 默认值 | 说明 |
|
||||
| --- | --- | --- | --- |
|
||||
| `CMVR_WITH_MSQUIC` | `ON` | `OFF` | 编译内置 QUIC 测试服务器 |
|
||||
| `CMVR_MSQUIC_ROOT` | 空 | 空 | Linux MsQuic 的安装前缀 |
|
||||
| `CMVR_CXX_RUNTIME` | 空 | 自动探测 | 非系统依赖前缀配套的 `libstdc++.so.6` |
|
||||
| `CMVR_ASSIMP_SCENE_PARSER` | 自动探测 | 自动探测 | Qt3D Assimp 场景解析插件文件;用于加载 STL、DAE 和 3DS 网格 |
|
||||
| `CMAKE_BUILD_TYPE` | `Release`(教程) | `Release`(教程) | `Debug` 或 `Release` |
|
||||
|
||||
未启用 MsQuic 时,QUIC 页面仍会显示,但启动服务会给出明确提示,不影响 gRPC、Demo、音视频和 URDF 功能。
|
||||
|
||||
## 开发与排错
|
||||
|
||||
- CMake 配置找不到 Qt:设置 `CMAKE_PREFIX_PATH` 指向 Qt 安装前缀。
|
||||
- 找不到 gRPC 插件:确认安装了 `grpc_cpp_plugin`,并且 gRPC CMake 包与运行库来自同一前缀。
|
||||
- Proto 编译或链接版本错误:`protoc`、Protobuf 头文件和 Protobuf 库必须来自同一套安装。
|
||||
- 出现 `GLIBCXX_* not found`:不要混用不兼容的编译器和 C++ 运行库。CMake 会优先链接 gRPC/Qt 前缀内配套的 `libstdc++.so.6`;特殊环境可通过 `-DCMVR_CXX_RUNTIME=/path/to/libstdc++.so.6` 显式指定。
|
||||
- 只有 `演示 · demo_arm` 能显示,AUBO、Elfin、小研模型为空:`demo_arm`
|
||||
仅使用 Qt3D 内置几何体,其他模型需要 Assimp 场景解析插件加载 STL、DAE
|
||||
和 3DS 网格。在 Debian/Ubuntu 上执行
|
||||
`sudo apt install qt3d-assimpsceneimport-plugin`,然后重新运行 CMake 和构建。
|
||||
CMake 会检测插件并将其复制到程序目录的 `sceneparsers/`;如果使用自定义
|
||||
Qt,可通过
|
||||
`-DCMVR_ASSIMP_SCENE_PARSER=/path/to/libassimpsceneimport.so` 指定插件。
|
||||
构建后应存在
|
||||
`bin/release/sceneparsers/libassimpsceneimport.so`(Windows 对应
|
||||
`assimpsceneimport.dll`)。如果插件存在但仍加载失败,查看应用日志中的
|
||||
`Qt3D 无法加载网格` 信息,并确认插件与所用 Qt 版本及架构一致。
|
||||
- Linux 没有声音:检查 Qt Multimedia 后端、系统音频服务和 GStreamer 插件。
|
||||
- QUIC 无法启动:检查 MsQuic 动态库搜索路径、PFX 文件、密码、监听地址和防火墙。
|
||||
|
||||
Proto 约定和目录说明见 [protos/README.md](protos/README.md)。
|
||||
|
||||
## 软件设置与界面主题
|
||||
|
||||
仿生头页面默认显示「常用操作」:从已连接设备中选择仿生头后,可直接调用预设表情、说话动作、停止和检查设备,并查看调用反馈;原有 JSON 调试界面保留在「全部接口」。断开连接或无可用设备时,快捷操作不可用。
|
||||
|
||||
任务编排的画布操作与机械臂点位规划一致:选中节点后在同层后方插入;点击「添加到选中循环」后向循环末尾添加,点击「切换到根流程末尾」返回根流程。右侧标签实时显示添加位置。拖动仅调整同层顺序,右键拖动画布,双击编辑,循环右上角按钮折叠或展开。实线连接循环与子节点,蓝色虚线连接同层的先后节点。执行中禁止编辑节点;空循环在执行前报错,已有 JSON 数据格式保持兼容。
|
||||
|
||||
任务编排可根据已连接设备列表选择仿生头,支持高兴、惊讶、疲惫、愤怒、悲伤、打哈欠、开始/停止说话、紧急停止及检查设备。动作使用服务端预设,不要求手写 JSON。节点检查 gRPC 结果和反馈头中的业务成功标志,失败停止编排;成功后等待设定时间再继续。开始说话仅启动持续动作,不播放音频;需用停止说话节点结束。服务端急停不保证停止说话线程,检查设备也不代表已获得实际运动状态。自定义姿态及流式表情因服务端字段实现不完整,暂不提供快捷编排入口。
|
||||
|
||||
侧栏底部的「软件设置」用于调整界面字体、基础字号、启动页面、窗口大小与位置记忆、启动最大化、日志保留行数和自动滚动。字体与日志设置保存后立即生效,启动选项下次启动生效。
|
||||
|
||||
「启动与机械臂」中的模型预览开关默认关闭,保存后重启程序生效。关闭时不初始化 Qt3D 场景,机械臂连接、遥测和位置控制照常使用。该开关允许用户选择是否加载模型,并不修复特定 Qt3D/显卡组合的渲染兼容性问题。
|
||||
|
||||
软件设置保存在可执行文件旁的 `data/application_settings.json`,采用原子写入。现有连接信息、标定、机械臂点位和任务编排继续使用各自的存储,不因修改软件设置而被清除。目录没有写入权限时,设置弹窗会显示保存失败原因。
|
||||
|
||||
仓库中的 `resources/application_settings.json` 保存随程序分发的初始配置。qmake 构建、CMake 构建和安装时仅在目标目录缺少配置文件时复制,已有的软件设置不会被覆盖;程序的读取路径保持不变。
|
||||
|
||||
全局主题入口为 `src/applicationstyle.cpp` 和 `styles.qss`。新增消息提示/确认请使用 `AppMessageBox`,其按钮返回值兼容原 `QMessageBox`;输入框、文件选择和普通对话框统一使用应用标题栏。新弹窗不要设置 `WindowStaysOnTopHint`,有父窗口时使用窗口级模态。
|
||||
|
||||
程序图标为 `icons/cmvr-app.svg` / `icons/cmvr-app.ico`。修改图标后可运行 `scripts/generate_application_icon.py` 更新 Windows 多尺寸 ICO;qmake 和 CMake 均已嵌入可执行文件图标。
|
||||
|
||||
工作流工作区以 `am-freescan` 的组件库、端口连线、循环容器、右侧参数面板和图数据结构为依据,以原生 Qt 实现。参考仓库位于 `am-freescan/`,独立管理 Git;来源提交为 `6ace9b1`。两个编辑入口均独立全屏打开。
|
||||
|
||||
点位库支持搜索、拖入、重命名、行号排序、组复制和组内多流程。循环和等待可添加到画布;节点可自由移动,循环标题移动时带动容器内节点。任务编排左侧可搜索设备组件,右侧可直接编辑接口参数、超时和等待。端口连线决定执行顺序,Delete 删除选中的连线;不连通、环路和跨容器连线在运行前报错。右键/中键或空白处平移,Ctrl+滚轮缩放,工具栏可显示全部。
|
||||
|
||||
两个画布均支持 Ctrl+C / Ctrl+V 复制粘贴选中节点。循环连同其内部节点一起复制,多节点保留内部连线;粘贴生成新的节点 ID 并偏移位置,外部连线不复制。点位流程粘贴时要求当前点位库中存在所引用的点位。执行期间禁用粘贴,文本输入框继续使用原有文本复制粘贴。
|
||||
|
||||
连线使用方向流动动画,拖动节点时实时跟随端口,选中后可按 Delete 删除。两个编辑器均提供撤销/重做按钮,支持 Ctrl+Z、Ctrl+Shift+Z 和 Ctrl+Y;删除循环时,其内部节点、参数与连线一起恢复。输入框获得焦点时,快捷键用于文字撤销/重做;切换流程会重置当前编辑历史,执行期间禁用图编辑撤销。
|
||||
|
||||
`joint_programs.json` 的组保留点位库和多个流程;每个流程用 `flowData` 字符串存储真实 `{nodes,edges}` 图。任务存储使用 `{flows:[{id,name,flowData}],activeFlowId}`,不再把旧的任务数组作为主存储。节点沿用中心坐标 `x/y`、`properties.parentId`、循环 `children` 和 `sourceNodeId/targetNodeId` 连线。旧文件读取后备份为 `.before-graph.<标识>.bak` 并迁移;转换失败时保留原文件。
|
||||
|
||||
两个入口均能导入/导出 am-freescan 图 JSON。导出保留 cmvr-es 的服务全名、方法名、完整请求、接口超时及 protobuf 描述集;循环和等待使用原生 loop/sleep 节点。组合点位保留多臂并行运动和逐臂关节顺序校验。网页侧通过自身 gRPC 连接调用 cmvr-es,上位机无需保持运行。资源使用参考项目的机器人角色和设备用途绑定,网页导出后在上位机导入时选择实际设备。
|
||||
|
||||
克隆仓库包含对应的网页 JSON 导入/导出、参数面板和 `CMVR_GRPC_UNARY` / `CMVR_ARM_POINT_BATCH` 后端执行适配。这些改动必须由网页项目单独构建部署后才生效,本地修改不代表线上已支持。组合调用先校验所有机械臂,再并行下发同步 MoveJ;失败或取消时取消剩余调用并请求停止。任务编排使用图执行器,支持并行分支、汇合屏障及嵌套循环;每次循环独立记录前驱完成状态,各 RPC 以独立调用标识收取结果。失败和停止会取消全部在途 RPC;已执行的调用不会自动重试。点位执行器保留单路径与组合点位调用。条件分支、运行时参数引用、扫描仪等其他领域动作不能无损转换时明确报错。等待可位于开始之后、任务之后或循环内部。
|
||||
|
||||
2026-11-25:协议同步到 cmvr-es `linbo_dev` 提交 `c8b71b2b380bbc53ce7eda148707362f09a1066d`(已合入 `dev` 的 `7d230fa5`)。API 设备类型新增 Touch=8,BioHead=9、Motor=10、MotorSystem=11。当前服务端不提供 moveJPose、SystemService.ExecuteJsonCommand、命令标识/代际反馈和公制深度元数据;界面禁用末端位姿 MoveJ,动作队列使用 MoveL,缺少身份及深度元数据的触摸定位明确返回不支持。普通关节 MoveJ、相机图像和预览保持可用。
|
||||
|
||||
任务编排的“机器人管理”可添加、编辑、连接或断开多台 cmvr-es,连接记录保存到 `data/workflow_robots.json`,重新打开软件后不自动连接额外机器人。“执行设置”分别选择机器人和该机器人上的同类设备;节点记录 `robotId`,旧节点默认绑定主界面机器人。不同机器人的同名设备、参数查询、演示状态和执行通道独立;离线、删除或找不到设备时明确报错,不会改发到其他机器人。导出 am-freescan 使用独立机器人角色和设备用途,未知机器人导入后须重新绑定。
|
||||
|
||||
任务与点位画布统一为左键框选、Ctrl+左键追加/取消选择、右键拖动画布,左键仍可拖动节点和连接端口。框选节点支持整体拖动和批量删除,删除可撤销。节点参数面板固定显示执行设置和保存按钮,输入参数单独滚动;关节名与角度并排显示,限位单独显示,行高随字体和名称换行调整。
|
||||
@ -1,202 +0,0 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@ -1,26 +0,0 @@
|
||||
# AGV Demo scan map
|
||||
|
||||
`demo_scan.smap` is a Demo-only conversion of the official TurtleBot 4 depot
|
||||
occupancy sample. It is never a connected robot's downloaded map.
|
||||
|
||||
Sources (TurtleBot 4 `jazzy` branch, Apache-2.0):
|
||||
|
||||
- [depot.pgm](https://github.com/turtlebot/turtlebot4/blob/jazzy/turtlebot4_navigation/maps/depot.pgm)
|
||||
- [depot.yaml](https://github.com/turtlebot/turtlebot4/blob/jazzy/turtlebot4_navigation/maps/depot.yaml)
|
||||
- [LICENSE](https://github.com/turtlebot/turtlebot4/blob/jazzy/LICENSE), copied unchanged to `LICENSE.txt`.
|
||||
|
||||
The original raster is 755 x 380 cells at 0.04 m/cell with origin
|
||||
(-15.1, -7.74), giving bounds (-15.1, -7.74) to (15.1, 7.46).
|
||||
For each 2 x 2 raster block containing an occupied cell (gray < 128), the
|
||||
first occupied cell's center becomes one `normal_pos_list` point. World
|
||||
coordinates use x = origin.x + (column + 0.5) * resolution and
|
||||
y = origin.y + (height - row - 0.5) * resolution. This retains 3,217
|
||||
real scan samples, including thin boundaries, without synthesizing walls.
|
||||
Free and unknown cells do not become scan points.
|
||||
|
||||
The 11 named stations and 10 bidirectional connections are added solely for
|
||||
Demonstration. Routes are serialized by `AgvMapDocument::addRoute`.
|
||||
LM10 and LM4 use y = 0.2 m to avoid occupied samples on y = 0;
|
||||
all station centers and route centerlines were checked against the original
|
||||
PGM at 0.01 m intervals and lie in free cells. This is a visual Demo layout,
|
||||
not a robot navigation or clearance certificate.
|
||||
File diff suppressed because one or more lines are too long
@ -1,9 +0,0 @@
|
||||
# Seed a new installation without replacing settings saved by the user.
|
||||
if(NOT DEFINED SOURCE OR NOT DEFINED DESTINATION)
|
||||
message(FATAL_ERROR "SOURCE and DESTINATION must be specified")
|
||||
endif()
|
||||
if(NOT EXISTS "${DESTINATION}")
|
||||
get_filename_component(settings_directory "${DESTINATION}" DIRECTORY)
|
||||
file(MAKE_DIRECTORY "${settings_directory}")
|
||||
configure_file("${SOURCE}" "${DESTINATION}" COPYONLY)
|
||||
endif()
|
||||
@ -1,80 +0,0 @@
|
||||
# 单相机自动识别与定位模式
|
||||
|
||||
实现日期:2026-10-12;2026-10-13 合并新版相机页与协议。
|
||||
|
||||
连接服务后,上位机通过 `CameraService.GetStatus` 获取当前物理相机型号、序列号、采集代次和能力。服务端 `AutoCamera` 只启动唯一已连接的相机:RealSense 或 MVS 工业相机。没有相机、发现多台或驱动不可用时不会任意选择设备。
|
||||
|
||||
| 实际数据 | 页面模式 |
|
||||
| --- | --- |
|
||||
| 有效原始图像、内参、采集时间、公制配准深度 | RGBD 深度定位 |
|
||||
| 有效原始图像、内参、采集时间,无深度 | 二维平面定位 |
|
||||
| 其余情况或旧服务没有能力字段 | 视频预览;标定/取点受缺失条件限制 |
|
||||
|
||||
相机选择、标定和末端操作复用现有 gRPC、解码和显示通道。深度预览不能借给标定页:进入标定或末端页时,同相机的深度会话会结束并重新订阅 RGB。修改相机身份、采集代次、分辨率或内参会清除锁定画面、目标点和待执行路径。不会自动恢复旧运动。
|
||||
|
||||
## 服务端配置
|
||||
|
||||
源码在 `F:/cmvr-es/cmvr-es`;新驱动位于 `cmvr-es/devices/camera/auto_camera` 和 `mvs_camera`。把现有相机配置中的独立后端替换成一个 `auto_camera` 条目,保留其逻辑 ID 和 DeviceManager 相机引用;不要同时启用同一硬件的旧 RealSense/MVS 条目。
|
||||
|
||||
以下是 CameraRootConfig 的 protobuf 文本示例。`camera_active` 是示例 ID,实际使用原配置的 ID;MVS 的序列号及内参必须填写真实标定值。
|
||||
|
||||
```text
|
||||
camera {
|
||||
cameras {
|
||||
id: "camera_active"
|
||||
auto_camera {
|
||||
id: "camera_active"
|
||||
realsense {
|
||||
camera_mode: CAMERA_MODE_VIDEO
|
||||
capture { width: 640 height: 480 fps: 30 stream_mode: STREAM_MODE_RGBD }
|
||||
encoder { width: 640 height: 480 fps: 30 codec: "H264" buffer_size: 4 }
|
||||
align_mode: ALIGN_MODE_COLOR
|
||||
sync: true
|
||||
}
|
||||
mvs {
|
||||
capture { width: 2448 height: 2048 fps: 15 stream_mode: STREAM_MODE_RGB }
|
||||
encoder { width: 1224 height: 1024 fps: 15 codec: "H264" buffer_size: 4 }
|
||||
// 在实机确认原始尺寸;本示例未提供内参,因此只允许预览。
|
||||
// 填入 serial、fx/fy/cx/cy、5 个 coeffs 和 calibration_width/height。
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
MVS 驱动使用官方 `MvCameraControl`,与项目的 HCNetSDK 网络监控相机驱动不同。服务端需安装对应系统/架构的 MVS SDK,CMake 通过 `MVS_ROOT`、`MVS_INCLUDE_DIR` 和 `MVS_LIBRARY` 查找 SDK。例如已有正常构建目录中:
|
||||
|
||||
```bash
|
||||
MVS_ROOT=/opt/MVS cmake -S . -B build
|
||||
cmake --build build --target cmvr_es
|
||||
```
|
||||
|
||||
没有 SDK 时会编译明确报告不可用的适配器,不影响原有驱动。SDK 可用后使用 Mono8、软件触发、独立采集线程;SDK 缓冲区复制后释放。触发前与读到图像后的服务器 UTC 构成真实采集区间,再按请求/响应时刻转换到客户端时间区间。曝光超时结束本次采集,关闭旧会话后才允许重新触发。
|
||||
|
||||
二维内参必须绑定当前物理序列号、原始分辨率。ROI 偏移、binning 和 decimation 需读取验证为完整标定几何;无法验证时只预览。RealSense 纯 COLOR 配置缺少本实现需要的可靠采集时间,亦只预览。不要使用截图时间冒充曝光时间。
|
||||
|
||||
`CameraState.codec` 保留已分发协议的编号 10,`capabilities` 使用 11。上位机和新服务端协议已同步。此前尚未部署的相机能力实验版本使用过编号 10,不能与本版本混用。
|
||||
|
||||
AbstractCamera 和媒体帧结构发生兼容扩展,因此部署时需重编全部相关驱动和服务;不要只替换一个驱动库。此次只在隔离目录构建与测试,没有替换运行中的服务或配置。
|
||||
|
||||
## 二维相机的末端操作
|
||||
|
||||
MV-CS050-10UM 没有深度。选择对应手眼和 TCP 后,在任务配置导出平面模板,填入真实基座坐标系下的平面原点、朝向离开表面的单位法向和操作半径,再导入。模板默认数值只是占位,不能直接作为测量结果。
|
||||
|
||||
文件字段为 `schema_version=1`、`units="m"`、`frame="robot_base"`、`name`、`robot_id`、`camera_serial`、`handeye_name`、`handeye_fingerprint`、`intrinsics_fingerprint`、`origin[3]`、`normal[3]`、`operating_radius_m`。指纹由模板自动生成;改换标定或内参后重新导出匹配模板。平面保存沿用 QSettings,并按服务器、机械臂和相机序列号隔离。
|
||||
|
||||
像素经去畸变生成相机射线,再使用手眼关系和锁定时的机器人位姿变换到基座,与已知平面求交。界面显示相机与基座 XYZ;滑动沿用该平面法向与 TCP。目标像素不需要棋盘格,但必须位于已配置的真实平面和有效操作范围内。只靠二维像素和手眼矩阵不能确定任意空间深度。
|
||||
|
||||
RGBD 继续使用真实公制深度、同帧配准和原有时序校验;深度失败不会静默改用平面。旧手眼文件缺少物理序列号时需要显式确认归属,已知序列号不匹配的记录不显示、不使用。
|
||||
|
||||
## 三轴力传感器
|
||||
|
||||
界面只显示“未接入”,尚无真实力控。后续接口需要:传感器身份、绑定机器人、有效标记、采集时间、Fx/Fy/Fz(N)、测量坐标系、传感器到工具安装变换、量程及故障。三轴力不包含力矩。接触停止与闭环应在有明确时效保证的服务端/控制器实现;加装改变工具尺寸后需重新 TCP 标定。
|
||||
|
||||
## 已完成验证与边界
|
||||
|
||||
- Qt 5.12.4 / MinGW 7.3 / C++14 构建;手眼与末端 UI 回归、协议兼容、原始灰度取点与平面换算。
|
||||
- 服务端隔离构建,单采集实例、替换相机、旧租约释放、故障退出、媒体 Hub、真实回环 gRPC 双向订阅结束测试通过。
|
||||
- 上述服务端验证完成于 2026-10-12。2026-10-13 合并时调整了 codec/capabilities 字段编号;本地协议与 Qt 构建通过,但服务器连接超时,最后的编号调整尚未远端复编。
|
||||
- 当前机器及服务器未安装 MVS SDK。启用 SDK 的分支、MV-CS050-10UM 实机采集和真实相机替换尚未验证。
|
||||
- 未发送真实机械臂运动指令;之前“读数变化而机器人未实际运动”的问题仍需独立实机确认。
|
||||
@ -1,31 +0,0 @@
|
||||
# 控制器活动 TCP 偏移读取
|
||||
|
||||
TCP 标定页面的“从控制器读取”使用当前连接和机械臂 ID,通过已有
|
||||
`cmvr.api.ArmService/ExecuteJsonCommand` 发送:
|
||||
|
||||
```json
|
||||
{"command":"get_active_tcp_offset"}
|
||||
```
|
||||
|
||||
服务端目前由 AuboArm 驱动调用 `getRobotConfig()->getTcpOffset()`。
|
||||
其他未适配驱动返回不支持,不把失败转换成零偏移。
|
||||
响应同时包含 `success`、`device_id`、`offset`(六个数)、
|
||||
`transform: T_flange_tcp`、`units: m_rad` 和
|
||||
`rotation_convention: RzRyRx`。这是相对法兰的活动工具偏移,不是机器人基座下的实时 TCP 位姿。
|
||||
|
||||
Qt 校验设备、单位、姿态约定和有限数值后,将平移转换为 mm,角度转换为度。
|
||||
读取会清空本轮采样,成功后确认偏移;失败保持未确认。
|
||||
切换连接或机械臂后,过期响应不会被应用。
|
||||
这是按按钮实时读取,不是后台持续轮询;在示教器更换活动工具后需重新读取。
|
||||
|
||||
## 2026-10-10 验证
|
||||
|
||||
- TCP 页面测试 17 项通过。
|
||||
- loopback 集成测试通过,覆盖错误单位、设备不匹配、无效值、合法零偏移及 UI 回填。
|
||||
- Qt 调试程序编译通过,输出 `bin/debug/CmvrControlStation_touch_preview.exe`。
|
||||
- 服务器驱动编译、链接通过,已按用户授权重启服务。
|
||||
- `192.168.0.28:50052` 的 `aubo_arm` 实际读取成功,返回六项零偏移。
|
||||
- 部署时原驱动备份:服务器
|
||||
`/home/cmvr/Projects/cmvr-es/output/lib/libaubo_arm.so.before-tcp-20261010-162143`。
|
||||
- 服务以原参数和环境后台启动,日志为服务器 `/tmp/cmvr-tcp-service.log`。
|
||||
此次未更改设备配置或开机启动设置。
|
||||
@ -1,154 +0,0 @@
|
||||
# Qt 手眼标定迁移说明
|
||||
|
||||
## 页面与使用流程
|
||||
|
||||
沿用侧栏「复杂控制 → 手眼标定」的第 14 号页面。原先该入口显示占位内容,`ui/handeyecalibrationwidget.ui/.h/.cpp` 是空 QWidget;现在入口实例化这个已有页面类。没有新增一级导航。
|
||||
|
||||
布局沿用机械臂页、相机页和 TCP 标定页的 `panel`、`sectionTitle`、`mutedLabel`、按钮和表格样式。`.ui` 管理滚动页面:左上为相机视频与检测,右上为相机选择及标定配置,下方并排放置采样数据与标定结果 / 保存。配置项按每行两组紧凑排列;板型参数和动态列表使用当前工程已有的 C++ 控件方式。
|
||||
|
||||
1. 在机械臂页面选择实际设备并连接服务。在工具坐标标定页确认控制器当前活动工具偏移,用于将反馈 TCP 位姿还原为法兰位姿。
|
||||
2. 手眼页的相机来自现有相机配置列表。选择相机并开始视频,复用当前 RobotClient 相机流。已有相机流可以共享;页面只停止自己启动的流。
|
||||
3. 选择安装方式、棋盘格 / ChArUco、实际板尺寸。棋盘格行列表示内角点数;ChArUco 表示方格数。尺寸界面使用 mm,算法使用 m。
|
||||
4. 核对真实相机畸变模型、彩色对齐方式和服务器时钟后勾选确认。实时检测预览按算法完成速度刷新,角点、轴线始终绘制在它们所属的图像上。
|
||||
5. 每次停稳后采集。联合标定至少 6 组(位姿法至少 5 组),建议 12–15 组,并覆盖至少两个独立旋转轴。表格显示两组位姿、重投影误差及帧时间。
|
||||
6. 计算后查看 4×4 矩阵、方向、重投影 / AX=XB / 固定目标误差。异常点会标记为已剔除。质量不合格的结果可以查看但不能保存。
|
||||
7. 输入名称保存。机械臂页速度控制区域「视觉坐标 → 手眼标定 · 仅坐标转换」的列表立即刷新。同名更新和删除都使用现有 QMessageBox 交互。
|
||||
8. 在机械臂页选择记录,输入相机坐标点,点击转换。显示实际计算出的基座坐标。此操作不会发送运动。
|
||||
|
||||
## 真实调用链与线程
|
||||
|
||||
- 视频:已有 `CameraService.GetRGBImageStream` → RobotClient 流读取线程 → 已有 FFmpeg VideoDecoder → `videoFrameReceived(cameraId, VideoFrame, detail)` → 原有 VideoRenderWidget。
|
||||
- 为 `VideoFrame` 增加原始解码 PTS、对应相机内参和帧时间。通过解码 PTS 与输入包匹配元数据,避免 B 帧 / 延迟解码时把最新包时间错误赋给旧图像。未知、重复或无法匹配的 PTS 不用于采点。
|
||||
- 原始彩色尺寸与内参:新增的 RobotClient 请求包装复用同一 CameraService 通道上的真实 `GetRGBImage` RPC。校验 BGR / 灰度数据长度、维度、有限正焦距及畸变系数;QImage 持有独立数据。
|
||||
- 算法:HandEyeBridge 的 QThread 内运行持久 QProcess,执行随应用部署的 Python worker。图像平面编码、检测和求解不阻塞 GUI。一次只允许一个算法请求,限制积压;页面退出停止算法,线程析构时释放资源。
|
||||
- 机器人:复用 `requestTcpCalibrationPose` → 工作线程 `GetArmInfo` 与 `getRobotState` → `actual_tcp_pose`、关节速度和安全 / 运行状态校验。没有增加机器人通信实例。该接口仅接受现有代码已核对姿态约定的驱动;未知驱动返回明确错误,不猜测单位。
|
||||
- 位姿回调、视频回调和算法结果最终都在 UI 线程更新控件。请求 token 和算法代次隔离过期响应;连接、机械臂、相机、参考工具及参数变化会失效当前采样过程。
|
||||
|
||||
## phone 算法来源与数学定义
|
||||
|
||||
源文件:`F:/phone/scripts/handeye_calibration_gui.py`。
|
||||
|
||||
迁移至 `scripts/handeye_math.py` / `scripts/handeye_worker.py`,保留主要函数和源代码行区间注释:
|
||||
|
||||
- `estimate_planar_pose`(174–247):平面 IPPE 候选与 PnP 精化。
|
||||
- `estimate_charuco_pose`(250–266)及页面检测逻辑(1905–1952)。
|
||||
- `solve_handeye_matrix`(289–311)。
|
||||
- `fixed_target_consistency`(322–361)。
|
||||
- `ax_xb_all_pair_metrics`(364–389)。
|
||||
- `leave_one_out_handeye_metrics`(427–478)。
|
||||
- `robust_handeye_calibration`(481–592):五种 OpenCV 求解器、自动比较、MAD 异常值剔除与交叉验证。
|
||||
|
||||
支持 Eye-in-Hand 和 Eye-to-Hand。沿用 phone 重投影筛选和质量阈值,并补充输入边界、SE(3)、正深度、独立旋转轴检查。至少保留 5 个有效样本;不会为了凑够样本数保留不合格的重投影点。
|
||||
|
||||
所有矩阵采用行优先存储、列向量左乘、平移单位 m。`T_parent_child` 表示将 child 坐标表达成 parent 坐标:
|
||||
|
||||
- 机器人输入:`T_base_flange`。反馈实际为活动 TCP;先按 `T_base_tcp × inverse(T_flange_tcp)` 还原。
|
||||
- 相机输入:`T_camera_target`,由当前图像中的真实标定板检测取得。
|
||||
- Eye-in-Hand 输出:`T_flange_camera`;使用时 `p_base = T_base_flange × T_flange_camera × p_camera`。
|
||||
- Eye-to-Hand 输出:`T_base_camera`;使用时 `p_base = T_base_camera × p_camera`。
|
||||
- 机器人姿态沿现有已验证接口使用 m、rad,旋转为 `Rz(rz) × Ry(ry) × Rx(rx)`。界面显示 mm / degree,未更改底层姿态定义。
|
||||
|
||||
## 联合标定与重投影非线性精修(2026-09-30)
|
||||
|
||||
页面默认选择“联合标定 + 重投影精修”,保留“原有手眼标定(对比)”。切换计算方式或初值算法只失效计算结果,保留原始采样;更改相机、安装方式、标定板参数仍重置采样。布局保持左上视频、右上配置、下方采样与结果。
|
||||
|
||||
新增 `scripts/handeye_refinement.py::refine_joint`。先沿用 phone 的求解器选择和异常样本剔除产生初值,再通过 Huber 损失、SE(3) 指数更新和解析雅可比的阻尼 LM,同时优化两个刚体变换(12 个自由度)。这是在迁移算法之上的新增实现,不声称 phone 原代码已经包含联合精修。没有新增 scipy 或 C++ OpenCV 依赖。
|
||||
|
||||
定义 `G = T_base_flange`、`C = T_camera_target`:
|
||||
|
||||
| 安装方式 | 优化 X | 优化 Y | 约束 | 用于投影的预测 C |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| Eye-in-Hand | T_flange_camera | T_base_target | G X C = Y | inverse(X) inverse(G) Y |
|
||||
| Eye-to-Hand | T_base_camera | T_flange_target | X C = G Y | inverse(X) G Y |
|
||||
|
||||
两种模式均对所有保留帧的真实角点进行联合优化。每帧保存 `image_points`、单位为 m 的 `object_points`、对应 `corner_ids`、该帧缩放后的 `K`、Brown 畸变 `D`、图像尺寸和两组测量位姿。支持 ChArUco 每帧可见角点不同;不能将局部列表下标代替板上 ID。内参、畸变、板尺寸及机器人位姿作为固定测量值,不在本阶段估计机器人运动学或相机内参。
|
||||
|
||||
质量检查及验证:
|
||||
|
||||
- 联合标定至少 6 个有效样本,原有算法仍至少 5 个;界面建议采集 12–15 个并覆盖多个旋转轴。
|
||||
- Huber 点残差阈值 1.5 px,最多 80 次迭代。使用平移 0.2 m / 旋转 1 rad 的参数尺度检查雅可比秩及条件数(上限 1e6)。检查矩阵、坐标对应、正深度和有限值;不收敛不允许保存。
|
||||
- RMS 定义为所有角点二维残差范数的均方根,不是单坐标 RMS,也不是原有 PnP 均值。精修后全点 RMS 上限 1.5 px;鲁棒目标不得增加;全点 RMS 上升不得超过 max(0.01 px, 初值 RMS 的 1%)。
|
||||
- 6–8 组使用留一验证,9 组及以上使用确定性的三折验证。每折只用训练帧重新求手眼初值与两个变换,不复用全量拟合结果;在未参与该折拟合的帧上计算像素残差。所有保留帧必须完成验证,汇总 RMS 上限 3 px。此前 phone 的异常样本筛选是全量初始化步骤,因此此验证针对保留样本的拟合稳定性,不替代独立实机验收数据。
|
||||
- 保留原有 AX=XB 与固定目标一致性 5 mm / 2° 检查。像素误差低不能覆盖物理位姿不一致。所有诊断及验证折索引映射回原始采样列表。
|
||||
|
||||
QSettings 仍使用原来的 v1 主键和机械臂隔离方式;新增可选字段 `refinement`、`observations`,兼容旧记录。保存初始及最终 X/Y、矩阵含义、两类像素误差、迭代及条件数、验证折、完整原始观测。旧记录没有角点,仍可选择使用,但不能直接进行像素精修。读取联合结果时校验质量标记、方向和主矩阵一致性。
|
||||
|
||||
Record.transform 保存最终 X,既有 `calibrationsChanged` 刷新与 `cameraPointToBase` 流程因此实际使用精修后的矩阵。Y 同时保存并展示,用于标定板固定关系;不将它误用为机械臂视觉运动的手眼矩阵。当前没有完整视觉运动接口的 TODO 保持不变。
|
||||
|
||||
本次增量文件:新增 `scripts/handeye_refinement.py`、`tests/test_handeye_refinement.py`、`tests/test_handeye_joint_worker.py`;修改 worker、原手眼页面 `.h/.cpp/.ui`、HandEyeStore `.h/.cpp`、存储与页面测试、qmake/CMake 脚本部署和本说明。其余先前迁移文件不因联合优化而重构。
|
||||
|
||||
相关数学资料:[Tabb / Ahmad Yousef 的联合标定迭代方法论文(含修订说明)](https://arxiv.org/abs/1907.12425);针孔/Brown 投影使用 [OpenCV projectPoints 文档](https://docs.opencv.org/4.x/d9/d0c/group__calib3d.html)。这里固定内参的独立实现不等同于复现论文全部实验配置,真实定位精度仍需实机独立点位验证。
|
||||
|
||||
## 采样同步与已确认的相机限制
|
||||
|
||||
采样执行「静止位姿读前 → 新视频帧检测 → 静止位姿读后」。帧的服务器 UTC 时间必须位于读取时间窗内、PTS 匹配且未过期;前后法兰偏差不得超过 0.5 mm / 0.2°。整组保存两类变换、帧序号和读前读后时间。重复采样、运动、超时、检测失败都不追加记录。
|
||||
|
||||
这是静止条件下的软件配对,**不是传感器硬件曝光同步**。当前服务的部分时间戳是编码 / 处理时间,因此仍需保持机械臂及对应固定物静止,并确保两端时钟同步。上线前需要在实机上验证该时间模型。
|
||||
|
||||
从当前后端源码已确认以下限制,并在 Qt 侧拒绝不确定数据:
|
||||
|
||||
- unary `GetRGBImage` 不填拍摄时间戳,RealSense 还可能返回缓存图。因此单帧 RPC 只提供原生尺寸与内参,不直接用于成对采样。
|
||||
- RealSense 编码流缩放后未缩放内参。Qt 根据原生图像尺寸换算焦距和主点,校验宽高比与流内参一致性;不支持任意裁剪。
|
||||
- RealSense 深度对齐 RGB 的现有内参存在语义问题。使用者必须确认原生彩色或对齐到彩色,不能把深度对齐画面用于本实现。
|
||||
- 当前 UVC 后端没有有效标定内参;Hikvision 原生单帧接口未实现。它们会收到明确提示,不能绕过有效内参检查采点。
|
||||
- 协议没有畸变模型字段。当前检测适用普通针孔 / Brown 模型;鱼眼或未知模型不能直接套用。
|
||||
|
||||
## 持久化与机械臂页面使用
|
||||
|
||||
沿用应用默认 QSettings(正常运行组织 CMVR、应用 CMVR Control Station;Windows 通常位于 HKCU/Software/CMVR/CMVR Control Station)。主键 `handEyeCalibration/v1/<SHA256(endpoint + NUL + device)>`,记录当前连接和机械臂,其他机械臂不会混入列表。
|
||||
|
||||
每条记录包含名称、相机 ID、安装模式、求解器、创建时间、完整矩阵、方向、单位、有效样本数、误差、板参数和内参。允许同一机械臂的多个相机、多次标定;不静默覆盖同名结果。
|
||||
|
||||
保存 / 修改 / 删除成功后发出 `calibrationsChanged`,MainWindow 根据当前上下文转发给 HandEyeMotionWidget 重新加载。启动及切换机械臂也从同一个存储加载,并恢复当前选择。配置损坏、非有限数、非刚体矩阵、写入失败均返回错误。
|
||||
|
||||
HandEyeMotionWidget 读取选中记录的完整矩阵,实际调用 `HandEyeStore::cameraPointToBase`。Eye-in-Hand 在转换时重新读取当前真实位姿,并去掉控制器活动 TCP 偏移。转换结果通过 `basePointPrepared(cameraId, profileName, baseXYZmetres)` 提供;输入、选择、连接、参考偏移变化会清空旧结果。
|
||||
|
||||
保留一处业务 TODO:当前工程没有视觉目标运动流程及目标姿态语义,不能凭一个相机点推造完整 MoveL 目标。将来应由真实视觉运动流程消费已准备的基座点并定义方向、工具关系和运动约束,本次不虚构该接口。
|
||||
|
||||
## 文件与运行环境
|
||||
|
||||
本次修改:
|
||||
|
||||
- `ui/handeyecalibrationwidget.ui/.h/.cpp`:原页面完整实现。
|
||||
- `src/mainwindow.cpp/.h`、`src/mainwindow_ui.cpp`:原入口实例化、信号槽、相机流共享和机械臂页嵌入。
|
||||
- `src/robotclient.cpp/.h`:现有相机 RPC 包装和流元数据传递。
|
||||
- `src/videoframe.h`、`src/videodecoder.cpp`:精确解码时间与帧元数据。
|
||||
- `CmvrControlStation.pro`、`CMakeLists.txt`:新源码和 Python 算法脚本部署。
|
||||
- `styles.qss`:速度控制三个页签的宽度及视觉坐标输入框留白,沿用已有配色和字体。
|
||||
|
||||
本次新增:
|
||||
|
||||
- `src/handeyebridge.h/.cpp`:异步算法桥接。
|
||||
- `src/handeyestore.h/.cpp`:既有 QSettings 下的记录和坐标转换。
|
||||
- `src/handeyemotionwidget.h/.cpp`:机械臂页内部的记录选择和转换区域。
|
||||
- `scripts/handeye_math.py`、`scripts/handeye_worker.py`。
|
||||
- `tests/test_handeye_worker.py`、`tests/handeyestore_test.cpp/.pro`、`tests/handeyemotion_test.cpp/.pro`、`tests/handeyeui_test.cpp/.pro`、`tests/handeyeintegration_test.cpp`、`tests/run_handeye_integration.py`。
|
||||
- 本说明。
|
||||
|
||||
未升级 Qt 或 C++,未改造其他导航。算法现在使用随上位机部署的独立 Python 运行时、OpenCV(含 aruco)和 NumPy;进入页面自动检查,无需操作人员安装或选择环境。旧环境设置和 `CMVR_HANDEYE_PYTHON` 不再用于程序启动。三个脚本和运行时均随 qmake / CMake 部署,详见 [内置运行时说明](HANDEYE_RUNTIME.md)。
|
||||
|
||||
## 验证记录
|
||||
|
||||
### 2026-10-08:采样照片与 URDF 更新
|
||||
|
||||
- 采样表新增“采样照片 / 查看”。算法进程仅对成对采集请求,将用于检测的原始帧编码成 JPEG;通过时间与静止校验后,图像和该行观测一起入缓存。查看窗口可切换角点/坐标轴叠加;不会使用后续视频帧替换照片。
|
||||
- 照片仅在本次采样会话缓存,每张最多 2 MiB、最多 100 组。删除行、重置和切换采样上下文同步释放;不写入 QSettings,重启后不能恢复照片。原始角点、内参及标定记录仍按原机制持久化。Windows 构建随程序部署 Qt JPEG 插件。
|
||||
- 机械臂页“视觉坐标”中,“标定结果”下拉框仍按服务器和机械臂隔离,选中矩阵进入原有相机点到基座点转换;新增“URDF 标定更新”。可读取当前模型或选择 URDF,明确选择参考 Link、相机光学 Link,确认坐标关系后导出新文件并加载到现有模型查看器。
|
||||
- Eye-in-Hand 使用 `Flange_T_Camera`,参考 Link 必须对应标定法兰;Eye-to-Hand 使用 `Base_T_Camera`,参考 Link 必须对应标定基座。相机 Link 必须是该标定的光学坐标系,不能直接将标定矩阵写到有额外旋转的相机外壳坐标系。
|
||||
- `src/handeyeurdf.h/.cpp` 解析并验证模型;现有相机入口关节必须固定,参考到该关节父 Link 的链必须固定。写入 `T_parent_camera = inverse(T_reference_parent) * T_reference_camera`。不存在的相机 Link 创建为参考 Link 的固定子节点;m/rad 与 URDF XYZ/RPY 一致。
|
||||
- 原 URDF 保留,禁止覆盖源文件或其他已有目标文件。输出经 QSaveFile 原子保存;相对 mesh/texture 路径转为绝对路径,`package://` 保留原语义,建议输出到原模型目录。模型加载失败时提示并尝试恢复旧模型;导出的文件仍保留。重启可通过已有 URDF 选择入口加载导出文件。
|
||||
- 不修改运动关节,不发送机器人运动指令。无法表达为上述固定链时明确报错。模块测试 17 项、机械臂页面测试 23 项通过,覆盖两种模式、现有/新增光学 Link、完整矩阵重建、切换上下文失效、源文件保留和窄面板布局;区域高度不足时纵向滚动,不挤压输入框。
|
||||
- 照片相关页面测试 18 项、Python 检测和数学测试 41 项通过。MainWindow 本机回环联调确认导出的模型通过既有 URDF 查看器加载;未连接真实设备。
|
||||
|
||||
- Qt 5.12.4 / MinGW 7.3 / C++14:完整 Debug 工程编译、链接通过。验证产物 `bin/debug/CmvrControlStation_handeye_preview.exe`,三个算法脚本已部署到同目录的 scripts 中。
|
||||
- Python 检测 / 数学 / 联合精修测试:37 项通过,覆盖五种初值求解器、两种模式的两组变换、合成真值、噪声、异常点、退化姿态、雅可比数值核对、独立验证、棋盘格 / 部分 ChArUco、像素格式及错误输入。
|
||||
- QSettings 与矩阵转换测试:90 项通过,包含旧记录兼容、完整原始观测与联合矩阵持久化、拒绝损坏数据。
|
||||
- 机械臂页记录选择与坐标转换测试:12 项通过。
|
||||
- Qt 页面与真实 Python 进程测试:14 项通过,覆盖启动失败重启、实际检测、原始角点配对、重复点、缺失时间戳、过期响应、相机替换及内参缩放;两种模式均实际经过计算、保存、重新加载和相机点转换,核对独立合成真值。
|
||||
- MainWindow + RobotClient 本机回环 gRPC 联调通过:原始 BGR、内参、无效数据、断线 / 演示拒绝、保存 / 删除即时同步、机器人隔离、两种实际坐标转换、编码格式和相机流所有权。未产生机器人运动指令。
|
||||
- 现有 TCP 全链路回归通过,包括真实回环 MoveL 目标计算、停止及参考偏移失效处理。
|
||||
- 已渲染手眼页与机械臂页检查布局。离屏 OpenGL 环境不能作为实机视频画面验收。
|
||||
|
||||
编码视频的 PTS 匹配路径已完成编译和代码检查,但没有完成压缩流端到端自动测试:本机 FFmpeg 不含 H.264 编码器,phone OpenCV 的 H.264 写出也缺少 OpenH264;未为测试安装或下载额外依赖。需要在真实服务器视频流上补做解码时间戳对应检查。
|
||||
|
||||
以上自动测试使用合成板图、合成坐标真值及本机回环假服务,不等同于相机和机械臂实机精度验收。实机仍需独立点位验证及上述帧时间检查。
|
||||
@ -1,63 +0,0 @@
|
||||
# 内置手眼标定运行时
|
||||
|
||||
上位机仅从自身目录加载 `runtime/handeye/python.exe` 和 `scripts/handeye_worker.py`,不再读取旧的 `handEyeCalibration/python` 设置、`CMVR_HANDEYE_PYTHON` 或系统 Python。进入手眼页面自动检查;关闭页面释放进程。算法仍在工作线程管理的独立进程中运行,保持界面响应。
|
||||
|
||||
页面已移除算法环境、路径、浏览与检查控件。组件缺失时提示重新部署完整程序,不要求操作人员安装依赖。
|
||||
|
||||
## 发布目录
|
||||
|
||||
```text
|
||||
上位机目录/
|
||||
CmvrControlStation_handeye_preview.exe # 当前 Debug 验证程序
|
||||
...原有 Qt、通信 DLL、模型、证书等资源...
|
||||
scripts/
|
||||
handeye_worker.py
|
||||
handeye_math.py
|
||||
handeye_refinement.py
|
||||
runtime/handeye/
|
||||
python.exe
|
||||
python312.dll
|
||||
python312.zip
|
||||
python312._pth
|
||||
LICENSE.txt
|
||||
manifest.json
|
||||
...Python 扩展和运行库...
|
||||
Lib/site-packages/
|
||||
numpy/
|
||||
numpy.libs/
|
||||
cv2/
|
||||
...对应 dist-info 元数据与许可证...
|
||||
```
|
||||
|
||||
发布时复制完整程序目录,不能只复制 EXE。运行时约 178 MiB(未压缩),无需目标电脑安装 Python、Anaconda 或 pip;启动、检测和求解均无需联网。Windows x64 运行时使用官方 CPython 3.12.4 嵌入式包,配合本项目已验证的 NumPy 2.5.2 和 OpenCV-contrib 4.11.0.86。
|
||||
|
||||
采用 [Python 官方嵌入式分发方式](https://docs.python.org/3.12/using/windows.html#the-embeddable-package)。`python312._pth` 只包含包内标准库和依赖路径,不启用用户 site-packages;Qt 使用 `-I -B -u` 启动并清除继承的 `PYTHON*` 环境变量。worker 只显式加入自身脚本目录,用于加载同包的数学模块。
|
||||
|
||||
## 开发构建
|
||||
|
||||
生成器为 `scripts/package_handeye_runtime.py`。首次构建运行时需使用具备上述已验证依赖的 Windows x64 Python 3.12 环境:
|
||||
|
||||
```powershell
|
||||
& 'F:\phone\.handeye_venv\Scripts\python.exe' -B scripts/package_handeye_runtime.py
|
||||
```
|
||||
|
||||
源虚拟环境只在**打包阶段**使用。生成器下载并校验固定 SHA256 的官方 Python ZIP,复制 NumPy、其依赖 DLL、OpenCV 和许可证,不复制虚拟环境、Anaconda、Jupyter 或其他设备 SDK。也可用 `--archive` 指定已下载的同一 ZIP 离线打包。成功后产生文件哈希清单及版本记录。
|
||||
|
||||
默认输出 `third_party/handeye-runtime`(二进制产物被 Git 忽略)。生成器拒绝覆盖已有目录;重新生成时指定新的 `--output`,审核后通过构建参数选择。现有运行时已生成,无需重复打包。
|
||||
|
||||
- qmake:默认读取上述目录,链接后复制至 `bin/debug/runtime/handeye` 或 Release 输出目录;可设置 `HAND_EYE_RUNTIME_DIR`。
|
||||
- CMake:通过 `CMVR_HAND_EYE_RUNTIME_DIR` 指定运行时;构建后复制,`cmake --install` 也包含运行时及算法脚本。
|
||||
- 缺少 `manifest.json` 时构建配置明确失败,避免产出缺失算法环境的安装目录。
|
||||
- 运行时原件或版本有变化后需重新执行链接 / 部署,不能只拷贝新 EXE。
|
||||
|
||||
本机实际验证使用 qmake / Qt 5.12.4 / MinGW 7.3;CMake 部署规则已补齐但未另行完整构建。
|
||||
|
||||
## 验证
|
||||
|
||||
```powershell
|
||||
& '.\third_party\handeye-runtime\python.exe' -I -B -m unittest discover -s tests -p 'test_handeye*.py' -v
|
||||
```
|
||||
|
||||
40 项通过,包含将完整运行时与脚本迁移至中文 / 空格临时目录、PATH 仅保留 Windows System32、设置无效 PYTHONHOME / PYTHONPATH,再执行真实棋盘检测和 Eye-in-Hand / Eye-to-Hand 联合精修;核对模块和搜索路径均位于迁移后的目录,验证文件哈希与许可证。
|
||||
|
||||
Qt 页面测试使用测试 EXE 同目录的 `runtime/handeye` 和 `scripts`,15 项通过,涵盖自动启动、隐藏后重启、忽略无效旧路径、真实成对采点、计算、保存、重新加载与实际坐标转换。没有在另外一台全新 Windows 电脑上验收;实机发布仍需验证原有 Qt、相机及通信依赖和机器人精度。
|
||||
@ -1,108 +0,0 @@
|
||||
# 新下载工程与原本地工程的差异及合并结果
|
||||
|
||||
日期:2026-10-13。
|
||||
|
||||
目标工程:`F:/QT/CmvrControlStation`。
|
||||
新版本来源:`F:/QT/CmvrControlStation-main/cmvrcontrolstation`。来源为解压快照,没有 `.git`,因此不能确认对应的远端提交。三方比较使用原本地 `HEAD 1473cee` 作为共同参考,并逐项处理实际内容差异。
|
||||
|
||||
## 主要区别
|
||||
|
||||
| 内容 | 新下载目录 | 原本地目录 / 合并处理 |
|
||||
| --- | --- | --- |
|
||||
| AGV | 地图控件、地图流、导航与手动速度控制更新 | 纳入更新 |
|
||||
| 关节动作 | 点位记录、分组、单步与循环流程编辑器 | 纳入更新,并补停止及等待回调联锁 |
|
||||
| 灵巧手 | 状态、指尖触觉数据及热图 | 纳入更新 |
|
||||
| 相机 | 设备下拉、状态、深度截图及预览控制 | 与本地自动识别、标定页视频复用合并 |
|
||||
| TCP | 两个标定/末端 `.cpp` 较旧,配套功能文件不完整 | 保留完整本地四点/六点法、控制器偏移读取、按机器人保存和实际点动 |
|
||||
| 手眼 | 缺少完整算法桥、存储及使用模块 | 保留本地联合标定、重投影精修、内置算法环境、照片缓存、URDF及坐标换算 |
|
||||
| 末端操作 | 缺少完整采点、路径和执行模块 | 保留任意像素、RGBD及二维平面定位、观察位和动作流程 |
|
||||
| 相机自适应 | 没有能力/物理身份/采集代次链路 | 保留单相机自动识别及切换,详见 CAMERA_AUTO_MODE.md |
|
||||
|
||||
忽略换行方式后,共有 13 个双方修改文件、10 个仅新版本修改文件、7 个新版本新增文件、6 个仅本地修改文件,以及 72 个仅本地新增文件。`include`、`lib`、`tools`、`models`、`icons` 内容没有实质变化:头文件、部分文本模型和图标只有 LF/CRLF 差异;89 个库文件逐字节一致。这些依赖目录没有覆盖。
|
||||
|
||||
## 合并策略与冲突修复
|
||||
|
||||
- 三方合并 28 个来源文件;保留本地功能文件、脚本、内置算法运行时和测试。源目录保持未修改。
|
||||
- CMake/qmake 纳入 AGV、JointFlowEditor、TactileHeatmapWidget,同时保留本地标定/末端模块和算法部署。保持 Qt 5.12.4、MinGW 7.3、C++14。
|
||||
- 合并 MainWindow/RobotClient 的入口、信号、异步回调与资源生命周期,保留现有 16 个页面。标定页继续获得真实机械臂关节遥测。
|
||||
- 新相机下拉代替旧输入框后继续同步当前标定上下文。标定与末端页只复用 RGB 会话;已有深度会话时结束旧模式并重建 RGB。
|
||||
- 被替换视频会话的终止通知不再关闭新预览。视频控件保留本地动态比例;复查后恢复静态照片与取点标记共用画布的实现,避免照片子控件遮盖标记。
|
||||
- 全局停止、机械臂停止、断开及同设备其他动作会取消关节流程;自身流程 MoveJ 不触发自我取消。等待回调校验执行代次,旧回调不能推进新的流程。
|
||||
- 解决 protobuf 字段碰撞:保留 `CameraState.codec=10`,使用 `capabilities=11`;同步本地服务端协议。不能把字段号冲突当作普通文本拼接。
|
||||
|
||||
新增源文件:`src/agvmapviewwidget.*`、`src/jointfloweditor.*`、`src/tactileheatmapwidget.*`、`resources/joint_programs.json`。该 JSON 保留为来源资源,没有覆盖运行目录的现有用户点位文件。
|
||||
|
||||
## 验证
|
||||
|
||||
- 合并预览程序完整编译和链接成功:`bin/debug/CmvrControlStation_merged_preview.exe`。
|
||||
- 末端操作:25 项通过;手眼 UI:22 项通过;手眼选择/变换/URDF:23 项通过;TCP 算法:16 项通过。
|
||||
- 协议兼容:3 项通过,包括已分发的第 10 号 codec 字段。
|
||||
- 关节流程:4 类停止/手动动作联锁及旧等待回调,共 5 个回归场景通过。修复前这些场景均失败。
|
||||
- 真实 RobotClient 的本地回环测试通过:按机器人 TCP 列表、保存传播、实际 MoveL 目标换算、TCP 枢轴、取消及切换设备;原始灰度/RGBD数据校验、时钟换算、深度→RGB模式切换和终止通知。
|
||||
- 单相机 Demo 视频启动、接收画面和停止自检通过;源码无残留合并标记,`git diff --check` 通过。
|
||||
|
||||
以上回环运动请求仅连接测试自己的 `127.0.0.1` 临时服务,GUI流程测试不连接服务端。没有发送真实机械臂运动指令。
|
||||
|
||||
## 备份与使用
|
||||
|
||||
比较清单:`build/incoming-main-merge/comparison.json`;依赖比较:`native-comparison.json`。
|
||||
合并前备份:`local-sources-before.tar.gz` 和 `incoming-sources-before.tar.gz`,均在 `build/incoming-main-merge/`。它们保留双方存在差异的源文件,不包含构建目录和 SDK 库。
|
||||
|
||||
继续在原工程打开 `CmvrControlStation.pro`,执行 qmake 后编译即可。预览版使用单独名称,未覆盖之前的可执行文件。可使用 `bin/debug/run_merged_preview.cmd` 启动预览版;该入口补充本机 Qt DLL 搜索路径。
|
||||
|
||||
此次没有提交、推送或替换服务器服务。新增 AGV/灵巧手功能仍需匹配版本的服务端及实机验证。相机服务在 2026-10-12 完成隔离构建和生命周期测试;2026-10-13 最后同步的协议编号调整因服务器 `192.168.0.28` 连接超时,未在服务器重新编译。MVS SDK 及实机验证边界见 CAMERA_AUTO_MODE.md。
|
||||
|
||||
## 合并后本地功能保留复查(2026-10-13)
|
||||
|
||||
按用户要求再次对照 `local-sources-before.tar.gz`,检查了备份中的全部 101 个本地差异文件,而不是只检查 Git HEAD。没有文件丢失;修复后 78 个文件忽略换行方式后与备份一致,23 个有合并或本轮修复。原有 72 个本地独有文件全部存在,其中只有 1 个状态文档及 3 个补充回归测试发生变化,功能实现文件未被替换。原有 6 个仅本地修改文件全部保持一致。qmake/CMake 未删除本地源文件或内置算法部署项。
|
||||
|
||||
发现并修复了首次合并验证漏检的三类行为退化:
|
||||
|
||||
| 问题 | 原因和修复 | 验证 |
|
||||
| --- | --- | --- |
|
||||
| 末端锁定照片遮住 A/B 目标标记 | 新版 `VideoRenderWidget::setImage` 新建的 QLabel 位于 GL 取点层之上。恢复本地 RGBA/QPainter 同画布路径,同时恢复已有 Qt 5.12 RGBA 颜色兼容处理与像素映射几何。 | Windows 软件 OpenGL 下,旧版用例因覆盖层失败;修复后实际 framebuffer 能看到标记,视频几何/锁帧/选择测试通过。 |
|
||||
| 设备和相机列表不再周期刷新 | 新版删除了 `BackendWorker::pollGrpc` 中的状态查询,自动识别仅能依赖首次或手动刷新。恢复原 1 Hz 查询和 500 ms 超时。 | 真实 RobotClient 连接本地临时 SystemService,不启动机械臂遥测、不手动刷新,验证首次发现、设备替换和断开后停止轮询。修复前缺少周期发现。 |
|
||||
| URDF 三维场景、关节绑定和限位丢失 | 新版 `loadUrdf` 无条件提前返回,只保留关节名称。恢复完整场景与限位构建;完成组件树后再接入场景,保留新版异步加载指针防护。 | 修复前场景/限位为空;修复后验证限位、遥测驱动变换、示教限幅、重新加载,并使用项目 `right_arm.urdf` 验证网格和连续遥测渲染。 |
|
||||
|
||||
再次沿入口和保存链路确认保留:TCP 四点/六点法、控制器工具偏移读取、按机器人保存/加载及实际点动;手眼联合标定、非线性精修、算法运行时、采样照片、文件导入、矩阵选择及 URDF 导出;末端观察位、任意像素目标、RGBD/二维平面定位、动作流程、停止联锁;单相机能力与物理身份过滤。TCP 与末端的真实 RobotClient 回环运动测试重新通过。
|
||||
|
||||
本轮生产修改仅为 `src/videorenderwidget.cpp/.h`、`src/robotclient.cpp`、`src/urdfviewerwidget.cpp`。新增 `tests/merge_retention_test.cpp`、`tests/urdf_retention_test.cpp`,扩充 `tests/touchvideo_test.cpp`;测试链接工具增加平台参数,以便在 Windows 上验证实际绘制。主程序重新编译链接成功,预览启动入口不变。
|
||||
|
||||
最终回归结果:视频绘制/锁帧/坐标映射 9 项通过,末端 UI 25 项通过,手眼 UI 22 项通过;自动设备发现、URDF 场景/限位/示教/重新加载、TCP 和末端 RobotClient 回环均通过。手眼测试需要运行目录旁的内置 Python 环境,已将测试程序放到现有 `bin/debug` 运行环境后完成验证。UI 业务测试使用 offscreen;实际标记绘制和 URDF 用 Windows 软件 OpenGL 单独验证。
|
||||
|
||||
本轮修复前备份、逐文件清单、失败复现及通过日志在 `build/incoming-main-merge/local-retention-audit/`。这些验证使用本地临时服务和软件 OpenGL,没有连接真实机械臂;不能代替服务端部署、相机硬件及目标机器显卡驱动联调。
|
||||
|
||||
## 关节速度面板恢复
|
||||
|
||||
对照合并前源码备份、`F:/QT/CmvrControlStation-upload` 和 Git 历史(`5c207d4`、`1473cee`),确认历史面板采用“关节名 / 实时弧度 / − / 限位指示 / +”的动态行。当前 `rebuildArmJogControls` 原布局仍在,但只由 `GetArmInfo.joint_names` 初始化;同时遥测读取只遍历名称数组。服务端缺少 GetArmInfo 或只返回位置数组时,真实关节位置无法生成控制行。该条件已通过本地旧版接口模拟服务复现,不代表已检查用户正在运行的服务端。
|
||||
|
||||
恢复和合并处理:
|
||||
|
||||
- 沿用历史关节行样式、速度倍率、按住 SpeedJ 和松开停止,保留新版“点位与流程”、笛卡尔和视觉标签页。
|
||||
- 遥测按真实关节位置数组读取。缺少名称时显示 J1、J2…,数量及顺序来自当前设备反馈,不硬编码机器人或六轴。
|
||||
- 设备信息不完整时,由当前设备有效遥测初始化关节行;其他设备的消息不会修改当前面板。
|
||||
- 空信息不清除已恢复的关节行,相同信息不重复销毁按钮;确需重建时先结束当前点动。
|
||||
- 无数据时显示等待状态,断开后禁用正反向按钮,避免空白面板和固定的“控制就绪”提示。
|
||||
|
||||
本次修改 `src/mainwindow.cpp/.h`、`src/mainwindow_ui.cpp`、`src/robotclient.cpp`;新增 `tests/jointjog_restore_test.cpp`。备份为 `local-retention-audit/before-jog-restore.tar.gz`。测试使用临时 127.0.0.1 服务模拟缺少名称和 GetArmInfo 的控制器,覆盖实时角度、倍率、关节方向、松开停止、重复刷新、机器人隔离和动态轴数。主程序预览版已重新编译。
|
||||
|
||||
|
||||
## 2026-10-14 第二次增量合并
|
||||
|
||||
来源仍为 `F:/QT/CmvrControlStation-main/cmvrcontrolstation`,目标仍为原本地工程。本轮按昨天的来源备份做增量三方合并,生产代码只修改六个文件:`src/jointfloweditor.cpp/.h`、`src/mainwindow.cpp`、`src/mainwindow_ui.cpp`、`src/robotclient.cpp`、`protos/cmvr/api/arm_command.proto`。来源目录未修改;逐文件哈希检查确认其余本地生产源码没有覆盖或丢失。
|
||||
|
||||
合入更新:关节电流列(mA)及演示数据,协议 `JointState.current=6`;流程支持选中节点后插入、同级拖动排序及自动布局;流程窗口及操作提示同步更新。保留按真实 position 数组恢复关节行、按住点动/松开停止、动态轴数、机器人隔离、停止联锁、相机能力、TCP/手眼/末端功能接线。
|
||||
|
||||
修复来源版本中的问题:
|
||||
|
||||
- “切换到根流程末尾”同步清除场景和内部选择,避免继续插在旧选中节点之后。
|
||||
- 重建画布后同步插入位置提示;进入循环时清除旧卡片选择。
|
||||
- 析构前断开场景的选择回调,避免成员销毁后仍被场景析构访问;原版本已在独立测试中复现堆损坏退出。
|
||||
- 自动排列按整棵子树的占用宽度避让,避免相邻循环展开后子节点重叠;拖动只调整同级顺序。
|
||||
- 电流数组缺项显示“未提供”,NaN/Inf 显示“无效”,真实零值显示 `0`,负值保持原符号;数据随后缺失时清除旧读数。本地服务端尚未填充新字段,不能把此上位机更新视为电流实测接口已经部署。
|
||||
|
||||
新增 `tests/jointflow_update_test.cpp/.pro`,扩展 `tests/jointjog_restore_test.cpp`。流程测试覆盖根末尾、选中后插入、取消选择后追加、嵌套循环及保存加载、相邻循环不重叠、拖动事件排序和选中卡片析构。真实 RobotClient 的临时回环测试覆盖旧服务端无名称/无电流、新字段、零值、负值、NaN/Inf、短数组及撤销读数,继续验证原关节点动/停止/动态轴数。
|
||||
|
||||
验证:Qt 5.12.4 / MinGW 7.3 主程序完整编译链接成功;流程七个场景通过;电流/旧控制器关节回环通过;原流程停止/手动操作/旧定时回调联锁五个场景通过;设备自动发现、更换及断开停止轮询通过;相机协议兼容三个测试通过。测试只使用本地临时服务或 UI 事件,没有连接真实机械臂。没有改动服务端、提交或推送仓库。
|
||||
|
||||
本轮备份、精确增量、失败复现和通过日志位于 `build/incoming-main-merge/update-2026-10-14/`,修改前备份为 `before.tar.gz`。程序仍为 `bin/debug/CmvrControlStation_merged_preview.exe`,使用 `bin/debug/run_merged_preview.cmd` 启动。
|
||||
@ -1,94 +0,0 @@
|
||||
# 末端操作:视觉取点与触控笔动作
|
||||
|
||||
## 入口与适用范围
|
||||
|
||||
入口为“复杂操作 → 末端操作”,位于手眼标定下方,页面索引 15。沿用现有面板、表格、按钮、日志和 QMessageBox。实时视频在左上,标定、观察位和双列动作参数在右上,目标坐标和执行路径在下方;执行和停止按钮固定在底部,不随内容滚动。页面视频与配置约为 7:3,视频按实际帧比例填充可用空间。进入页面后在连接和相机就绪时自动预览,没有手眼结果时可先从相机列表选择设备。离开页面仅停止本页面启动的视频会话。
|
||||
|
||||
无需棋盘格、角点或目标检测。可在锁定 RGB 画面上选择任意具有可靠深度的目标像素。单击、双击支持 1–2 个目标并依次完成;滑动必须选择 A/B 两点,按 A → B 执行。目标坐标直接由配准深度计算;直线滑动会检查中间深度,不支持沿未知曲面自动贴面运动。
|
||||
|
||||
## 操作流程
|
||||
|
||||
1. 在机械臂页选择服务器和设备;在 TCP 标定页核对控制器当前活动 TCP 偏移。
|
||||
2. 进入末端操作,将机械臂放到便于观察且离开触控面的姿态,点击“录入当前观察位”。
|
||||
3. 选择该机器人已保存的手眼标定与触控笔 TCP。相机由手眼记录确定;支持 Eye-in-Hand 和 Eye-to-Hand。
|
||||
4. 三点示教已取消。触控姿态沿用观察位所选 TCP 的姿态,接近/抬笔沿相机 Z 轴反方向。观察位需保证笔姿适合目标,且有足够接近距离。
|
||||
5. 点击“回观察位”,或通过现有机械臂页面手动返回观察位。回程是直线段,操作人员必须先确认路径净空;页面没有碰撞模型或全局绕障规划。
|
||||
6. 开始视频,核对 RGB 内参、标准 Brown 畸变模型及相机/上位机时钟。点击“锁定观察画面”,系统请求同一组原始 RGBD,并使用前后静止位姿读数夹住彩色和深度的采集时间。
|
||||
7. 在画面内点选 A/B,黑边不参与选点;选满两点后再点击将开始一组新选点。“目标点坐标换算结果”即时显示像素坐标及相机系、基座系 XYZ(mm)。这里显示深度测量得到的目标点,未叠加接触偏移。设置单击、双击或滑动及动作参数。
|
||||
8. 点击“转换 / 预览”,检查控制器活动 TCP 的逐步运动路径,确认笔姿及净空后执行。换算结果与运动路径分开显示;重新锁图、切换机器人或标定后需重新取点。
|
||||
9. 任务执行接近、接触、必要的双击短抬/第二次接触或滑动、回撤、返回观察位。两点单击/双击在每个目标后分别回到观察位。
|
||||
|
||||
执行前再次读取真实位姿,必须仍在观察位(0.5 mm / 0.2°内)。锁定图像最多用于 60 秒内的执行。完成、停止、离开页面或切换机器人后清除目标和路径,需要重新取图。
|
||||
|
||||
## 数据和真实接口
|
||||
|
||||
- 视频复用 `RobotClient::videoFrameReceived`、`VideoRenderWidget` 及现有解码线程。仅停止本页面创建的相机流;借用已运行流时不重复创建相机实例。
|
||||
- 原始 RGBD 来自 `requestTouchRgbdImage` → 现有 `CameraService.GetRGBDImages`,请求启用 `require_metric_depth`。继续使用现有 RobotClient 工作线程;彩图深度、内参及时间戳作为一次结果排队送回 UI。
|
||||
- 原始 BGR 转为拥有独立存储的 QImage;保留原始 U16/F32 小端深度数据,按服务提供的 metres_per_unit 转为 m。只接受与原始 RGB 尺寸一致、配准到 RGB 且表示 RGB 光轴 Z 的深度,绝不使用可视化灰度或默认深度比例。
|
||||
- 锁图不再混用视频帧和单独深度帧。必须同时有两张图的真实采集时间戳,帧间时间差不超过 33 ms;过期快照会在原有超时内重试。两张图均须落在前后静止位姿读取之间。取消/退出后迟到结果作废。
|
||||
- 位姿复用 `requestTcpCalibrationPose` → `getRobotState.actual_tcp_pose`,检查真实连接、静止、故障/保护停止/急停、数据来源和请求时间。该值为控制器活动 TCP,先去除已核对的活动偏移得到法兰位姿。
|
||||
- 运动复用 `requestTcpJogMove` → 现有 `MoveL(base,tcp)`。路径把选定触控笔 TCP 的目标换算成控制器活动 TCP 目标;不把本机工具名称虚构成控制器坐标系。
|
||||
- 控制器逐步等待 RPC 结束,并重新读取实际位姿核对目标后才进入停留或下一步。不会将命令返回成功等同于已到位。
|
||||
- 手眼列表使用 `HandEyeStore`,TCP 列表使用 `TcpToolStore`,均按服务器和机械臂隔离。新增/修改/删除标定后即时刷新并废弃旧路径。
|
||||
|
||||
## 算法来源与坐标定义
|
||||
|
||||
phone 来源:`F:/phone/scripts/phone_workcell_motion.py` 的 `build_touch_action_plan` / `build_touch_queue_plan`,以及 `handeye_click_motion_gui.py` 的 `_localize_free_pixel`。迁移了观察位检查、单/双击和滑动顺序、法向短抬及返回观察位。Qt 版本补上接近与回撤、真实到位验证和取消状态机。
|
||||
|
||||
phone 的 `_localize_free_pixel` / `_depth_mm` 已迁移到 `TouchPlanner::resolveDepthPixels`:去畸变射线乘以光轴深度,再用手眼矩阵换算。局部取样收紧为 5×5 邻域、至少 5 个有效样本、深度极差不超过 5 mm,避免大范围填洞跨到其他表面;没有可靠深度就拒绝,不使用手动 Z 或三点平面补偿。
|
||||
|
||||
- 内部距离 m,姿态 rad,旋转约定 `Rz(rz) * Ry(ry) * Rx(rx)`,矩阵为行优先。
|
||||
- Eye-in-Hand:`Base_T_Camera = Base_T_Flange_at_capture * Flange_T_Camera`。
|
||||
- Eye-to-Hand:直接使用已保存的 `Base_T_Camera`。
|
||||
- 接近/回撤方向为 `-R_base_camera[:,2]`,沿用 phone 自由取点流程;它不是估计的表面法线。正接触偏移沿相机 +Z 推进,是几何位移,**不是力控**。触控方向由观察位笔姿决定,不因选点自动转笔。
|
||||
- `Base_T_ActiveTarget = Base_T_SelectedTarget * inverse(Flange_T_Selected) * Flange_T_Active`。
|
||||
- 拒绝无效单位/配准、NaN/Inf、深度空洞、遮挡边缘、失效标定及越界路径。滑动每隔不超过 2 像素采样,深度点偏离端点三维连线超过 3 mm 则拒绝。范围限制不替代机器人 IK、碰撞检查或关节限位。
|
||||
|
||||
## 停止、时间及保存
|
||||
|
||||
停止、页面离开、断连、控制器偏移/机器人切换、外部手动命令介入都会取消后续步骤。失败后不自动回程。位姿请求超时 6 秒,每段运动超时 30 秒,整段序列超时 180 秒。
|
||||
|
||||
双击间隔是抬笔到位后的停留时间;实际触点间隔还包含机械臂运动与通信时间,需要在目标触摸设备上验证双击识别阈值。没有硬实时或触控成功识别保证,也没有增加未经证实的压力传感器接口。
|
||||
|
||||
观察位、所用活动偏移及所选标定名称沿用 QSettings,保存于 `touchOperation/v1/SHA256(endpoint + NUL + deviceId)`。启动后按机器人恢复;活动 TCP 偏移改变时观察位失效。选定工具切换后清除图像和路径,并按新 TCP 偏移重新计算笔尖位姿。旧版三点配置不再读取。图像、目标点、已核对状态和待执行路径不会跨会话恢复。
|
||||
|
||||
## 文件与验证
|
||||
|
||||
新增 `src/touchplanner.h/.cpp`、`touchsequencecontroller.h/.cpp`、`touchvideowidget.h/.cpp`、`touchoperationwidget.h/.cpp`。
|
||||
|
||||
修改 MainWindow 的入口、上下文/列表同步、视频归属和退出取消;RobotClient 增加手动命令入队前的同步通知;qmake/CMake 登记源文件。未升级 Qt/C++,未引入额外依赖或新通信通道。
|
||||
|
||||
测试位于 `tests/touchplanner_test.*`、`touchsequence_test.*`、`touchvideo_test.*`、`touchoperation_test.*`,真实 RobotClient 与本机假服务联调为 `tests/touchintegration_test.cpp` / `run_touch_integration.py`。覆盖几何、偏移补偿、时序/取消、双点选取、图像内参缩放、配置隔离、实际回程、停止和外部命令介入。
|
||||
|
||||
测试使用合成图像/位姿和 127.0.0.1 模拟服务,不等同于实机触控精度、双击时序或碰撞验收。离屏 OpenGL 不支持真实视频显示,实机视频仍需在正常图形环境验证。
|
||||
|
||||
## 深度服务更新
|
||||
|
||||
客户端和服务端必须同时具备公制 RGBD 契约。Qt 已实现并编译;服务端源码修改在 `F:/QT/cmvr-es-depth`,补丁为 `patches/cmvr-es-metric-rgbd.patch`,基于 `cmvr-es origin/dev` 的 `9b2f5773e692706e4c618e23889befc18cbbc579`。
|
||||
|
||||
- `GetRGBDImages` 新增可选请求位和 `DepthGeometry`;旧请求行为不变。未升级服务会缺少元数据,客户端明确提示更新,不继续生成坐标。
|
||||
- RealSense 相机配置需要 `STREAM_MODE_RGBD`。服务复用现有采集线程保存原始帧组,用 SDK 的 `get_units()` 读取真实比例,用深度/彩色内外参反投影、变换、投影,按最近深度写入 RGB 尺寸的 F32 米制 Z 图。没有对应测量的像素保持 0。
|
||||
- 时间戳来自 SDK global/system time;仅有 hardware time 时拒绝公制快照,不伪造曝光时间。尝试启用 global time 失败不影响原有视频流程。
|
||||
- 当前补丁实现 RealSense 驱动,其他驱动需实现同一 metric RGBD 契约;普通彩色视频功能不受影响。没有按相机名称、IP 或机器人型号硬编码。
|
||||
- 2026-10-10 已在 `192.168.0.28` 完整编译并部署 RGBD 补丁。真实 `real_cam1` 返回 640×480 彩色图及同尺寸 F32 公制深度,三组有效深度约 10 万像素;彩色/深度采集时间差约 0.018 ms。未执行机械臂触控动作或验证触控精度。
|
||||
- Modified Brown / Inverse Brown 彩色模型通过 SDK 几何校正至针孔快照,深度同时投影到该快照;Inverse Brown 系数全零时直接使用等价的无畸变模型。无测量或无有效彩色映射的像素保留零深度。
|
||||
- Qt 使用服务端响应时间计算 RGBD 年龄,并映射到客户端请求/响应时间区间。保留原始服务器采集时间和时间区间宽度,不假设两台主机 UTC 完全一致;区间必须落在前后静止位姿之间,通信或图像年龄超过 1.5 秒拒绝。
|
||||
- 视频按钮下方显示取点前置条件;实时画面上的点击会提示先锁定同步 RGBD。“已核对相机内参与时钟”未勾选时,直接提示该项。
|
||||
- 服务器部署备份位于 `output/backup-rgbd-20261010-165239`,日志位于 `/tmp/cmvr-rgbd-service.log`。补丁文件已同步包含畸变模型兼容处理。
|
||||
|
||||
在对应服务端源代码根目录先执行 `git apply --check cmvr-es-metric-rgbd.patch`,再 `git apply cmvr-es-metric-rgbd.patch`,按照该工程原有构建流程重新生成 protobuf、编译并部署。不要只替换上位机而继续使用旧服务协议。
|
||||
|
||||
## 本地标定与观察位(2026-10-10)
|
||||
|
||||
手眼与 TCP 各自提供“已有标定 / 本地文件”模式,导入 JSON 后直接用于当前会话的坐标转换和路径计算,不写入控制器、不覆盖已有列表。切换机器人清除导入结果;重启需重新导入。文件含 endpoint/device 时必须与当前设备一致。
|
||||
|
||||
- TCP 支持 phone `save_tcp()` 格式:convention 以 T_flange_tcp 开头,aubo_pose_convention 明确米、ZYX、弧度,tool_name、translation_m[3]、orientation_rxyz[3]。
|
||||
- phone 手眼支持 primary_result、明确的 T_flange_camera 或 T_base_camera[4][4]、camera_matrix、solver、created_at、samples_used 及质量指标。不能将含义不明确的 T_eef_camera 直接作为法兰矩阵。缺少 cameraId 时绑定导入时选择的相机,需人工核对物理设备。
|
||||
- phone 导入质量门限:至少 5 组,平均重投影不超过 1.5 px,AX=XB 平移 RMS 不超过 5 mm、旋转 RMS 不超过 5°;缺失或异常指标拒绝导入。
|
||||
- Qt 单条手眼 JSON 支持 units=m_rad、name、cameraId、mode、matrixDirection、transformSI[16]、method、createdAt、sampleCount、metrics、intrinsics,以及可选 board/refinement/observations;沿用 HandEyeStore 校验。
|
||||
|
||||
观察位采用 phone TaughtPose 语义:同次真实状态的 joint_positions(rad)、所选触控笔 tcp1_pose(m、ZYX rad)、pose_frame=tcp1。内部同时保留控制器当前激活 TCP 位姿,用于现有 MoveL 接口;显示采用度与毫米。切换 TCP、机器人或控制器偏移后应重新示教;缺少关节角的旧记录不自动激活。
|
||||
|
||||
### 页面状态校验
|
||||
|
||||
实时预览采用与手眼页相同的自适应宽度和相机流;冻结画面仅用于同帧 RGBD 取点。锁定需手眼标定、当前 TCP 对应观察位及相机确认齐备。重新加载列表时,如 TCP 被删除或同名参数改变,观察位失效并要求重新录入。滑动需要 A/B 两点;底部提示按当前缺失条件显示下一步操作。
|
||||
@ -1,66 +0,0 @@
|
||||
# USB 仿生头调试
|
||||
|
||||
在上位机连接 `192.168.0.234:50053`,打开 **仿生头 → 常用操作**,选择 `usb_head`。
|
||||
该页面使用服务端已有的关节 gRPC 接口,不需要部署后端。
|
||||
|
||||
## 单路舵机
|
||||
|
||||
1. 点击 **刷新配置与目标**,读取当前设备的通道、弧度范围和已确认目标。
|
||||
2. 点击 **启用拖动调试**,显式设置直接位置模式;此操作不发送位置目标。
|
||||
3. 拖动对应滑块或输入弧度值。每条位置请求只包含该路舵机,不修改其他通道。
|
||||
|
||||
当前服务配置了 `eye_l_up`、`eye_l_lower`、`eye_l_v`、`eye_l_h`、`pwm8_local` 五路。
|
||||
实际显示和限制以服务端配置为准。拖动请求以 100 ms 节流,每路仅保留最新待发送值;松开后保留最终目标。
|
||||
|
||||
## 预设表情
|
||||
|
||||
页面从服务读取预设,目前包含中立、微笑、疲倦、惊讶、生气、当前姿态。
|
||||
选择表情只查看预设,点击 **执行所选表情** 才按其 ID 调用 gRPC;过渡时间支持 0.2~5 秒。
|
||||
“当前姿态”是服务端固定预设的名称,不是实时姿态采集。
|
||||
|
||||
服务要求已确认的完整起点。页面提示起点未就绪时,可显式点击 **归位并准备预设**,
|
||||
它会把所有配置通道移动到各自的初始目标,成功读回后才可执行预设。页面不会自动归位。
|
||||
|
||||
**取消表情** 会取消当前 RPC 并请求停止后续主机表情帧。设备没有硬件急停接口,
|
||||
这个按钮不能保证舵机立即停止,也不能撤回已经发给设备的命令。
|
||||
|
||||
## 本地自定义表情
|
||||
|
||||
右侧切换到 **本地表情**。本地库保存在上位机 `data/biohead_expressions.json`,
|
||||
按服务地址(区分演示和真实连接)及设备 ID 隔离,不会上传或覆盖设备预设。
|
||||
|
||||
1. 点击 **编辑输入(不发送)**,用左侧滑块和弧度输入编辑目标;此模式不向设备发送动作。
|
||||
2. 输入名称和 0.2~5 秒过渡时长,点击 **保存当前目标为新表情**。保存的是完整输入目标,
|
||||
不是实测姿态。名称重复会报错,不会悄悄覆盖已有记录。
|
||||
3. 选择本地表情只预览。点击 **载入目标** 才会填入左侧输入,仍然不会移动设备;修改后可
|
||||
点击 **更新所选**。**删除所选** 只删除本机记录,并需要确认。
|
||||
4. 点击 **执行本地表情** 才将完整目标通过现有 `SetHeadExpression` gRPC 接口执行。
|
||||
起点未就绪时需要显式归位准备;页面不会自动归位或重发失败动作。
|
||||
|
||||
若要从本地编辑恢复实际逐舵机调试,需重新点击 **启用拖动调试**,这一步只切换模式,
|
||||
不会自动发送编辑后的输入。配置缺失、通道不一致或目标超出当前设备范围时,禁用保存或执行。
|
||||
断线不会删除本地记录,重新连接同一服务及设备后可继续使用。文件损坏或写入失败会明确报错,
|
||||
不会显示保存成功。
|
||||
|
||||
## 状态和边界
|
||||
|
||||
- 服务提供的是已确认目标缓存,没有实际位置测量;确认成功不代表机械已经到位。
|
||||
- 打开页面、刷新状态、选择表情均不会发送位置命令。
|
||||
- 切换设备、切换“常用操作/全部接口”、离开仿生头页面或断线时,清除待发目标并取消当前请求;再次调试需要重新启用。
|
||||
- 切换“设备预设/本地表情”会清除待发目标并停用拖动调试;已经开始的表情需点击“取消表情”来取消。
|
||||
- 操作失败或超时后不自动重发,不自动重连或归位。先刷新状态,再明确选择下一步操作。
|
||||
- 只读状态查询使用独立的 6 秒预算。读取失败时暂停真实控制,保留同一设备的本地输入草稿和上次配置;可继续本地编辑或保存,手动刷新成功后再恢复控制。状态读取失败不会被描述为动作执行失败。
|
||||
- 页面移除了说话类快捷动作。原有任务编排和“全部接口”中的旧接口仍保留兼容。
|
||||
|
||||
## 编译
|
||||
|
||||
在 CMD 中执行(已安装本机项目依赖的情况下):
|
||||
|
||||
```bat
|
||||
cd /d C:\Users\LattePanda\Documents\CmvrControlStation-main
|
||||
set "PATH=E:\qt\qt5.12.4\5.12.4\mingw73_64\bin;E:\qt\qt5.12.4\Tools\mingw730_64\bin;%PATH%"
|
||||
qmake CmvrControlStation.pro
|
||||
mingw32-make -f Makefile.Release -j4
|
||||
```
|
||||
|
||||
关闭旧程序后重新编译,运行 `bin\release\CmvrControlStation.exe`。
|
||||
@ -1,28 +0,0 @@
|
||||
# TCP calibration migration implementation plan
|
||||
|
||||
Goal: fill existing navigation slot 13 with phone-equivalent fixed-point TCP calibration, using verified robot feedback and local QSettings persistence explicitly approved by the user.
|
||||
|
||||
Initial migration scope: retain Qt 5.12.4 / MinGW 7.3 / C++14, existing .pro fixes and certificate. Reuse current checkout because the user builds this exact project in Qt Creator. No robot motion, controller writes, new navigation or dependency installation in that phase.
|
||||
|
||||
Verified design:
|
||||
- Current TCP panel is createCalibrationEntryPage in mainwindow.cpp; no TCP .ui/class/CRUD exists. Keep its stack position. Dynamic internal widget follows panel/sectionTitle/mutedLabel/primaryButton and mechanical-arm tables; no global stylesheet changes.
|
||||
- phone scripts/handeye_calibration_gui.py solve_tcp_offset: >=4 base-to-flange poses, metres and ZYX Euler radians, Rz Ry Rx; stacked [R,-I] least squares. RMS mm, save blocked above 2mm. Orientation is manual, never claimed calibrated.
|
||||
- Existing getPose ignores requested flange on vendor backends; getPoseMatrix is unimplemented. Reuse RobotClient worker/channel and getRobotState, require verified AUBO vendor, validate stopped/connected/finite feedback. Derive flange with phone robot_backend.py transform chain from explicit user-confirmed active server TCP offset. Never use telemetry display cache or simulated samples.
|
||||
- No TCP save RPC/config fields. User explicitly selected local QSettings, separate local tool names and controller frames. Persist per endpoint and device. Do not make local selection change motion/controller settings.
|
||||
|
||||
Tasks / verification:
|
||||
- [x] Numerical module + tests: known pivot solution, rank/conditioning, invalid finite inputs, duplicate poses, noisy/high-error sets, Euler and flange/tool conversions. Compare Python phone solver.
|
||||
- [x] Additive worker request/result with request token; false/demo/disconnected/vendor unsupported/state errors return explicit failure. UI ignores late results after reset/device/session changes.
|
||||
- [x] Local tool store tests: namespace isolation, restart reload, bad data, duplicate name/update, current selection, sync failure reporting.
|
||||
- [x] Populate existing TCP page: tool name/list, manual orientation, active server TCP offset confirmation, 4+ sample rows, capture/overwrite, solve/clear/save/reload, residuals and RMS, local tool preview; log via MainWindow and use QMessageBox.
|
||||
- [x] UI tests with injected result signals (no hardware) for capture flow, source/tool changes, late responses, errors, invalid RMS, round-trip save/reload. Offscreen render inspect.
|
||||
- [x] Build existing Debug target, review changes, report precise limitations (local persistence, manually confirmed active TCP, AUBO pose adapter, hardware not tested).
|
||||
|
||||
User-requested follow-up: remove vendor/connection banner; return saved TCPs to the current robot's speed-control selector and actually use offsets for movement. This supersedes the initial phase's no-motion UI scope (no hardware commands are run during development).
|
||||
|
||||
- [x] Preserve per-endpoint/per-device QSettings storage and connect save/update/delete to the same robot's tool selector.
|
||||
- [x] Generic calibration UI with clear separation of the profile being edited and the profile selected for motion.
|
||||
- [x] Bounded local-tool jogging via verified MoveL(base,tcp) with fresh feedback and rigid-transform compensation; cancellable on release/context/stop/timeout.
|
||||
- [x] Invalidate active-TCP confirmation before ordinary named MoveL and mutable ArmService RPCs.
|
||||
- [x] Numerical/state-machine tests, robot-isolated UI/store tests and real loopback gRPC integration using MainWindow/RobotClient. Document finite-step and vendor-adapter limits.
|
||||
- [x] Build the complete app to an alternate filename because the user's original executable is running; preserve the process.
|
||||
@ -1,160 +0,0 @@
|
||||
# 单相机自动切换 Implementation Plan
|
||||
|
||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task. This task uses native execution in the existing session; no subagent dispatch.
|
||||
|
||||
**Goal:** 在同一服务端入口下替换 RealSense 与 MV-CS050-10UM,Qt 自动识别当前相机并切换 RGBD 或二维平面操作。
|
||||
|
||||
**Architecture:** 服务端增加一个自动相机适配器,保持逻辑设备 ID 稳定,实际型号、序列号和会话代次动态变化。适配器一次只拥有一个采集实例;Qt 通过 CameraService 查询真实能力,现有页面消费同一身份与图像。二维操作复用 TouchPlanner 的射线平面求交,配置仍使用 QSettings。
|
||||
|
||||
**Tech Stack:** Qt 5.12.4、现有 qmake/CMake、protobuf/gRPC、现有 OpenCV/FFmpeg/RealSense SDK;海康 MVS SDK 为服务端可选依赖。
|
||||
|
||||
**Spec:** `docs/superpowers/specs/2026-10-12-camera-capability-modes-design.md`
|
||||
|
||||
## Global Constraints
|
||||
|
||||
- 同一时间只使用一台相机,不实施双相机协同或并行采集。
|
||||
- 不硬编码 IP、名称或序列号。
|
||||
- 保留现有页面导航、视频获取通道、TCP 和手眼保存机制。
|
||||
- Qt 5.12.4 和现有 C++ 标准保持不变。
|
||||
- SDK 未安装时明确提示驱动不可用,不影响原有相机驱动构建。
|
||||
- 自动化测试不发送机械臂运动指令。
|
||||
- 力传感器尚无型号和协议,本次仅预留接入契约和状态;不提供真实力控。
|
||||
|
||||
## Review Focus
|
||||
|
||||
1. 同一逻辑设备 ID 换了硬件:必须检测序列号和会话变化,旧图像、标定与路径不得继续使用。
|
||||
2. 采集帧跨越机器人读取窗口,或两台机器时钟不同:保留时间不确定区间并拒绝不能确定同步的数据。
|
||||
3. 单台设备拔出或发现两台设备:清除活动相机,禁止静默选取设备或回退定位方式。
|
||||
4. 内参被 ROI、分辨率或镜头变化影响:阻止定位,不能缩放旧内参冒充新标定。
|
||||
5. MVS 缺失或传感器未接入:不伪造图像、深度、时间戳或零力反馈。
|
||||
|
||||
## Task 1: 服务端身份与能力协议
|
||||
|
||||
**Files:**
|
||||
- Modify (both repositories): `protos/cmvr/api/camera_command.proto`
|
||||
- Modify (server): `cmvr-es/devices/camera/abstract_camera.h`
|
||||
- Modify (server): `cmvr-es/service/grpc/src/grpc_camera_service.cpp`
|
||||
- Modify (server): RealSense header/source for actual device identity
|
||||
- Test (server, new): `cmvr-es/service/grpc/tests/camera_capabilities_test.cpp`
|
||||
|
||||
**Interfaces (new definitions, not existing interfaces):**
|
||||
- `CameraCapabilities` message: version, driver, model, serial, transport, raw_image, valid_intrinsics, capture_timestamp, metric_aligned_depth, distortion_model, session_generation, unavailable_reason.
|
||||
- Append `CameraState.capabilities`; append `FrameData.camera_serial` and `FrameData.camera_session_generation` using unused field numbers. Preserve existing fields.
|
||||
- `AbstractCamera::getCapabilities()` returns a value snapshot; default reports unsupported/unknown, never inferred capabilities.
|
||||
|
||||
- [ ] Write tests: empty capability fields remain unknown; non-depth driver cannot advertise metric depth; serialized legacy fields retain their values; raw and video frames carry the same hardware identity.
|
||||
- [ ] Run those tests to establish failure before adding capability fields and producers.
|
||||
- [ ] Extend both proto copies and regenerate using project build tooling. Use SDK-reported model/serial; RealSense metric capability additionally requires the supported depth output mode and geometry path.
|
||||
- [ ] Include identity, distortion model and real capture timestamp in raw GetRGBImage response, not response receipt time. Return no usable image when capture identity is missing or stale in automatic mode.
|
||||
- [ ] Run protocol/producer tests and existing camera stream policy tests; check that old clients ignore new fields.
|
||||
|
||||
## Task 2: MVS 灰度采集与单实例生命周期
|
||||
|
||||
**Files:**
|
||||
- Create (server): `cmvr-es/devices/camera/mvs_camera/include/mvs_camera.h`
|
||||
- Create (server): `cmvr-es/devices/camera/mvs_camera/src/mvs_camera.cpp`
|
||||
- Create (server): `cmvr-es/devices/camera/mvs_camera/CMakeLists.txt`
|
||||
- Create (server): `cmvr-es/devices/camera/mvs_camera/tests/mvs_camera_test.cpp`
|
||||
- Modify (both repositories): `protos/cmvr/config/camera_config/camera_config.proto`
|
||||
- Modify (server): `cmvr-es/devices/camera/CMakeLists.txt`
|
||||
|
||||
**Interfaces (new):**
|
||||
- `MvsCamera final : AbstractCamera` implements existing init/start/stop, state, raw image and encoded frame interfaces.
|
||||
- `MvsCameraConfig`: id, serial, capture, encoder, fx/fy/cx/cy, exactly five Brown distortion coefficients, calibration_width/height. Unspecified intrinsics do not prevent preview but disable calibration and positioning.
|
||||
- An SDK discovery helper returns attached model/serial/transport descriptors without starting acquisition.
|
||||
|
||||
- [ ] Obtain and inspect official MVS headers/sample definitions on the server before implementing calls. If SDK is unavailable, build the explicit unsupported adapter branch and document the hardware-validation limitation; do not fabricate SDK declarations.
|
||||
- [ ] Write fake-SDK tests: Mono8 ownership after buffer release, actual frame width/height, start/stop/restart, no duplicate producer, shutdown while awaiting frame, timeout, SDK missing.
|
||||
- [ ] Run tests to establish failure, then implement optional SDK compilation using its actual headers/libraries.
|
||||
- [ ] Acquire images on one worker, copy SDK-owned buffers before releasing them, and publish through the existing CameraStreamEncoder/stream interface. Preserve sensor frame number and distinguish SDK sensor timing from host receive timing; advertise timestamp capability only when bounded capture timing is actually established.
|
||||
- [ ] Keep raw acquisition dimensions separate from preview encoding dimensions. A mismatched intrinsics configuration blocks raw calibration capture, not video preview.
|
||||
- [ ] Run fake-SDK tests. With hardware/SDK present, verify real Mono8 snapshots and steady video without any robot moves.
|
||||
|
||||
## Task 3: 服务端自动相机适配器
|
||||
|
||||
**Files:**
|
||||
- Create (server): `cmvr-es/devices/camera/auto_camera/include/auto_camera.h`
|
||||
- Create (server): `cmvr-es/devices/camera/auto_camera/src/auto_camera.cpp`
|
||||
- Create (server): `cmvr-es/devices/camera/auto_camera/CMakeLists.txt`
|
||||
- Create (server): `cmvr-es/devices/camera/auto_camera/tests/auto_camera_test.cpp`
|
||||
- Modify (server): `cmvr-es/devices/camera/camera_factory.h`, camera CMakeLists
|
||||
- Modify (both repositories): camera_config.proto
|
||||
- Create (Qt documentation): `docs/CAMERA_AUTO_MODE.md` with a standalone configuration example; do not overwrite live configuration.
|
||||
|
||||
**Interfaces (new):**
|
||||
- `AutoCameraConfig`: id, RealSense capture/encoder profile, MVS profile, per-serial calibration entries.
|
||||
- `AutoCamera final : AbstractCamera`, stable logical id; internal device and capabilities refer to the current real hardware.
|
||||
- `discoverAttachedCamera()` uses RealSense SDK enumeration and Task 2 discovery; result is none, unique, ambiguous, or unavailable.
|
||||
- `session_generation` increases before clearing/replacing the delegate; all frames carry that generation.
|
||||
|
||||
- [ ] Write fake-device tests: unique RealSense, unique MVS, none, ambiguous, unplug during raw capture, replaced serial under the same logical ID, and outstanding stream lease during replacement.
|
||||
- [ ] Run tests to establish failure; implement delegation using existing camera methods, without changing DeviceManager global registration behavior.
|
||||
- [ ] On refresh/start, retire the old delegate and its producer before creating a new one. On disappearance, fail current reads and terminate the old stream epoch. Never encode or read through a freed delegate; never combine producer indexes from different sessions.
|
||||
- [ ] One logical auto-camera entry must replace the separate enabled camera entries in the deployment example. Preserve separate legacy configurations for users who do not enable auto mode.
|
||||
- [ ] Run lifecycle tests and verify at most one acquisition instance starts at any point. Refresh/reconnect supports replacement; automatic hotplug monitoring is added only if its lifecycle can use existing events without a second capture instance.
|
||||
|
||||
## Task 4: Qt 自动能力同步与标定归属
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/robotclient.h`, `src/robotclient.cpp`
|
||||
- Modify: `src/mainwindow.h`, `src/mainwindow.cpp`
|
||||
- Modify: `ui/handeyecalibrationwidget.h/.cpp/.ui`
|
||||
- Modify: `src/touchoperationwidget.h/.cpp`
|
||||
- Modify: `src/handeyestore.h/.cpp`, `src/calibrationfile.h`
|
||||
- Test: `tests/touchintegration_test.cpp`, `tests/touchoperation_test.cpp`, `tests/handeyeui_test.cpp`, `tests/handeyestore_test.cpp`
|
||||
|
||||
**Interfaces (new):**
|
||||
- `RobotClient::requestCameraCapabilities(const QString &cameraId, quint64 token)` and matching `cameraCapabilitiesReceived(token, cameraId, capabilities, success, detail)`.
|
||||
- Each calibration page accepts an active-camera snapshot through `setCameraCapabilities(const QString &cameraId, const QVariantMap &capabilities)`.
|
||||
- Add optional cameraSerial and cameraModel fields to HandEyeStore::Record. Preserve legacy files but require explicit identity confirmation; known mismatched identity must be rejected.
|
||||
|
||||
- [ ] Add tests for unknown capabilities, server reconnect, delayed stale response, same ID/new serial, same serial/new acquisition generation, and legacy result identity confirmation. Run them red.
|
||||
- [ ] Query asynchronously after connection and device discovery; match callbacks to session/token. MainWindow supplies the same unique active camera to the camera, handeye and touch pages. No new two-camera selector or navigation.
|
||||
- [ ] Clear frame/target/path on identity, generation, calibration or intrinsics changes. Hide incompatible saved results; reject imports belonging to another known camera.
|
||||
- [ ] Display current model and automatic mode compactly. Preview may start with unknown/missing intrinsics; sampling and coordinate conversion remain blocked with a precise reason.
|
||||
- [ ] Run widget/store/loopback tests. Assert read/identity refresh requests issue zero robot motion RPCs.
|
||||
|
||||
## Task 5: 二维平面参数与定位流程
|
||||
|
||||
**Files:**
|
||||
- Create: `src/touchplanestore.h/.cpp`
|
||||
- Modify: `src/touchoperationwidget.h/.cpp`, `src/touchplanner.h/.cpp`
|
||||
- Modify: `src/robotclient.h/.cpp`, `src/mainwindow.cpp`
|
||||
- Modify: `CmvrControlStation.pro`, `CMakeLists.txt` and affected test .pro files
|
||||
- Test: `tests/touchplanner_test.cpp`, `tests/touchoperation_test.cpp`, `tests/touchintegration_test.cpp`
|
||||
- Document: `docs/CAMERA_AUTO_MODE.md` with a plane JSON example
|
||||
|
||||
**Interfaces (new):**
|
||||
- `TouchPlaneStore::Record`: name, endpoint/device scope, cameraSerial, handEyeName, handEyeFingerprint, intrinsicsFingerprint, Plane, operatingRadiusM.
|
||||
- `TouchPlaneStore::parse(const QVariantMap &, Record &, QString &error)`, `load(QSettings &, endpoint, device, serial, Record &, error)`, `save(...)`. Parsing failure leaves the previous value unchanged.
|
||||
- Plane JSON contract: schema_version=1, units="m", frame="robot_base", name, robot_id, camera_serial, handeye_name/fingerprint, intrinsics_fingerprint, origin[3], normal[3], operating_radius_m. Normal must be finite and unit length within 1e-6; radius finite, >0 and <= configured maxTravelM.
|
||||
- A separate `requestTouchImage(cameraId, token)` returns raw image, matched intrinsics and bounded local capture interval without pretending it is RGBD. Existing requestTouchRgbdImage retains its strict checks.
|
||||
|
||||
- [ ] Add parser/load tests for serial mismatch, missing plane, invalid units/frame/normal, NaN, handeye replacement, intrinsics replacement and QSettings failure. Add UI tests for switching RGBD → plane → RGBD and failure remaining in the selected mode. Run red.
|
||||
- [ ] Add an import-plane button and short current-plane state to the existing task panel. Do not recreate the deleted mandatory three-contact teach controls.
|
||||
- [ ] Reuse observation pose bracketing. In plane mode lock the raw grayscale frame only when its capture interval is wholly inside the robot-reading interval. Reuse the existing RGBD clock conversion logic as a shared helper, preserving uncertainty and validation.
|
||||
- [ ] Call resolvePixels for plane mode, then invert Base_T_Camera for camera XYZ display. Use the imported plane normal for approach/retract and the current selected TCP orientation; call buildPlan with depthTargets=false. Keep depth mode's depth validation and depthTargets=true.
|
||||
- [ ] Keep explicit path preview/confirmation and existing motion interfaces. Missing depth is an error in depth mode, never an automatic fallback to plane mode.
|
||||
- [ ] Run geometry and widget tests, including parallel rays, behind-camera intersections, invalid plane bounds, old frames, and 1–2 arbitrary non-board target pixels. Verify existing RGBD tests still pass.
|
||||
|
||||
## Task 6: 力传感器预留与整体验证
|
||||
|
||||
**Files:**
|
||||
- Modify: `src/touchoperationwidget.h/.cpp`
|
||||
- Document: `docs/CAMERA_AUTO_MODE.md`
|
||||
- Test: `tests/touchoperation_test.cpp`
|
||||
|
||||
**Interfaces:**
|
||||
- This phase exposes no live sensor API. UI state is “力传感器:未接入”; no fabricated zero force, no enabled force-control buttons.
|
||||
- Document future sensor contract: identity, robot binding, Fx/Fy/Fz in N, timestamp/validity, force coordinate frame, sensor-to-tool transform, range and fault. Torque is explicitly absent for a three-axis sensor.
|
||||
|
||||
- [ ] Add a UI assertion that unconnected force is represented as unavailable and cannot be selected as contact feedback.
|
||||
- [ ] Implement the compact state row in the current action panel; document recalibration after mechanical installation changes and future server/controller-side contact control.
|
||||
- [ ] Run affected QtTest suites and Python handeye tests only where affected; regenerate protobufs and build the Qt executable with existing Qt/MinGW versions.
|
||||
- [ ] Build the server with MVS disabled to prove optional dependency compatibility; with SDK available, build the enabled adapter and verify a real camera stream and image/capability response.
|
||||
- [ ] Review diff for stale callbacks, frame/SDK buffer lifetime, single producer ownership, unit/transform direction, and changes outside this feature.
|
||||
- [ ] Report exact files and checks, and separately state any SDK/hardware limitation. Do not claim hardware switching or force control is validated without corresponding evidence. Do not send physical movement commands as an automatic check.
|
||||
|
||||
## Execution and deployment
|
||||
|
||||
Implement in the current session after plan review. Preserve existing local changes and do not commit or push unrelated files. Server changes are first built and packaged with the configuration example; a running service is not replaced as part of automated tests. The unresolved actual-motion issue remains a separate prerequisite for a physical touch trial.
|
||||
@ -1,15 +0,0 @@
|
||||
# 新下载工程与本地功能合并
|
||||
|
||||
> 按 superpowers:executing-plans 在当前会话执行;原工作区包含用户尚未提交的功能,不创建遗漏这些功能的空白分支。
|
||||
|
||||
目标:把 F:/QT/CmvrControlStation-main/cmvrcontrolstation 的更新合并到 F:/QT/CmvrControlStation,保留本地 TCP、手眼、末端操作、内置算法和相机自适应。
|
||||
|
||||
共同参考:本地 HEAD 1473cee;新目录为无 Git 元数据的源码快照,不能断言它来自哪个提交。
|
||||
|
||||
- [x] 按共同参考比较源码:13 个双方修改、10 个新版本修改、7 个新版本新增、6 个仅本地修改、72 个仅本地新增。
|
||||
- [x] 保存双方差异源码备份到 build/incoming-main-merge/*-sources-before.tar.gz,并在 staged 目录进行三方合并。
|
||||
- [x] 解决重叠改动:主窗口页面和遥测生命周期、RobotClient 信号/回调、视频比例与静态图显示、构建列表。
|
||||
- [x] 解决相机协议编号冲突:codec 保留上游编号 10,新增 capabilities 使用 11;同步本地服务端协议。服务器离线,末次远端复编未执行。
|
||||
- [x] 保持当前 Qt 5.12.4、C++14 与内置算法部署;保留本地完整标定模块,拒绝用缺少配套头文件的两个孤立 .cpp 覆盖。
|
||||
- [x] 重新生成 protobuf/UI,构建独立合并预览程序;回归 TCP/手眼/末端操作,检查新增页面。另修复并验证流程停止/旧定时器、深度→RGB切换/旧终止通知。
|
||||
- [x] 输出 docs/INCOMING_MAIN_MERGE.md;不提交、不推送、不更换真实机器人服务、不发送运动指令。
|
||||
@ -1,89 +0,0 @@
|
||||
# 相机能力自适应与末端操作模式
|
||||
|
||||
日期:2026-10-12。状态:用户已确认;已实施并完成可用环境验证,MVS SDK 与实机验证待对应环境就绪。
|
||||
|
||||
## 目标与范围
|
||||
|
||||
连接当前服务端后,按实际相机能力选择视频、手眼标定和末端定位流程。用户在 RealSense 和 MV-CS050-10UM 之间直接替换使用,同一时间只使用一台相机,不实施双相机协同或并行采集。保留现有页面导航、视频获取通道、TCP 和手眼保存机制。新增 MV-CS050-10UM 工业相机适配,以及二维平面定位模式;为后续末端三轴力传感器明确扩展边界。
|
||||
|
||||
当前使用的服务器、机械臂和相机均为动态设备,不硬编码 IP、名称或序列号。服务端识别当前实际连接的相机,向 Qt 返回唯一活动相机身份和能力。正常流程不要求用户在两台相机之间选择;发现结果不唯一或没有设备时,明确报告状态并停止自动接入,不能任意选取设备。
|
||||
|
||||
## 已核实的现有代码
|
||||
|
||||
- Qt `src/robotclient.cpp` 的 `deviceListFromStatus()` 读取系统设备列表的 `driverType`,但不足以判断具体相机型号或公制深度能力。
|
||||
- 服务端 `CameraService.GetStatus` 返回 `CameraState`;当前字段只有运行状态、帧率和分辨率。
|
||||
- 服务端 `devices/camera/hikvision_camera` 使用 HCNetSDK、`NET_DVR_Login_V40`,不能复用为 MV-CS050-10UM 的 MVS 工业相机驱动。
|
||||
- Qt `getHandEyeImage()` 已接受原始灰度图;二维相机的手眼算法无需重写。
|
||||
- Qt `getTouchRgbdImage()` 与 `TouchOperationWidget::acceptImage()` 当前强制要求同步、公制、配准 RGBD 数据。
|
||||
- `TouchPlanner::resolvePixels()` 已支持去畸变、相机射线与机器人基座平面求交,可复用。
|
||||
- `TouchPlanner::resolveDepthPixels()` 已支持深度定位,继续保留其数据有效性检查。
|
||||
- `ArmRobotState.actual_tcp_wrench` 虽有协议字段,当前机械臂驱动未找到真实三轴力传感器填充链路。灵巧手触觉模块的数据不等于末端力传感器数据。
|
||||
- 本机未找到 MVS SDK 头文件或运行库。海康适配需在服务端安装对应平台 SDK 后进行编译和实机验证。
|
||||
|
||||
## 接入方案
|
||||
|
||||
采用服务端统一适配,Qt 继续通过现有 RobotClient 和 CameraService 获取图像及状态。这能让三个现有页面共享设备身份、时间戳和资源管理。
|
||||
|
||||
备选方案是 Qt 直接接 USB 相机,但会形成两套设备与时间戳来源,也不能满足通过服务端识别相机的要求,因此不采用。
|
||||
|
||||
MVS 驱动独立于现有 HikvisionCamera。服务端使用相应 SDK 枚举真实连接设备,识别型号、序列号和连接方式,不能仅靠配置中的相机名称判断当前硬件。仅创建并启动当前活动相机的采集实例。SDK 未安装时明确提示驱动不可用,不影响原有相机驱动构建,不用 UVC 或监控 SDK 冒充接入成功。
|
||||
|
||||
切换时先停止旧相机的采集和视频生产,撤销旧设备的流租约并释放资源,再接入当前连接设备;不允许两台相机同时采集。界面在切换期间显示连接状态,旧帧、旧能力回包和旧图像请求不得进入新相机流程。设备更换可通过重新连接服务或刷新发现完成;服务端若支持热插拔通知,则复用该通知更新,不能以已配置但未连接的相机冒充活动设备。
|
||||
|
||||
## 能力信息与自动切换
|
||||
|
||||
兼容扩展 CameraState,包含版本、驱动、型号、序列号、连接类型、原始图像格式、有效内参状态、采集时间戳能力、公制配准深度能力和错误原因。新增字段必须按真实驱动结果填充,未知不能默认为支持。
|
||||
|
||||
连接成功、实际相机替换、设备发现结果更新和重新启动相机后查询能力。相机断开时清除能力缓存。回包须与服务器会话、相机身份和请求代次匹配,旧会话或旧相机回包不改变当前模式。
|
||||
|
||||
| 实际能力 | 自动模式 | 可用功能 |
|
||||
| --- | --- | --- |
|
||||
| 原始图像、有效内参、采集时间戳、公制配准深度 | RGBD 深度定位 | 视频、手眼标定、按深度定位任意有效像素 |
|
||||
| 原始图像、有效内参、采集时间戳,无深度 | 二维平面定位 | 视频、手眼标定、按已知平面定位任意有效像素 |
|
||||
| 只有视频或能力未知 | 视频预览 | 可显示视频;明确列出阻止标定或定位的缺失条件 |
|
||||
|
||||
不得仅凭 RealSense 品牌名称判定当前输出有有效深度。不得在 RGBD 深度失败时静默改用二维平面。
|
||||
|
||||
页面紧凑显示当前唯一活动相机、模式和必要条件,保持现有样式,不增加双相机选择或双画面。视频比例由帧尺寸决定,鼠标坐标始终映射到原始图像像素。
|
||||
|
||||
## 二维平面定位
|
||||
|
||||
MV-CS050-10UM 不提供深度。新增平面参数文件导入入口,不恢复用户已要求删除的强制三点接触示教 UI。
|
||||
|
||||
平面参数明确包括版本、名称、机器人身份、相机序列号、参考手眼标定、单位、坐标系、平面原点、单位法向、有效操作范围。内部使用米、机器人基座坐标系;导入时校验并保存到现有 QSettings 管理范围。页面展示当前平面和状态,缺少有效平面时允许视频,禁止生成运动路径。
|
||||
|
||||
计算链为原始像素 → 使用对应相机内参去畸变 → 相机射线 → 当前手眼变换与锁定时法兰位姿 → 基座射线与平面求交。输出相机 XYZ 和基座 XYZ,沿用现有 TCP 变换与动作序列。
|
||||
|
||||
平面定位需要一次性获得真实平面位置,但目标点不要求位于棋盘格或标定板上。仅手眼矩阵不能唯一恢复任意二维像素的三维位置。
|
||||
|
||||
拒绝无效内参、法向、相机后方交点、近平行射线、越界目标和过期图像。滑动路径须在平面有效范围内。
|
||||
|
||||
## 图像同步与标定归属
|
||||
|
||||
二维与 RGBD 都沿用现有采集前后读取真实机械臂位姿的流程。采集图像和内参必须同源、同帧,保留采集时刻及时间不确定区间;只使用处于位姿读取窗口内的帧。
|
||||
|
||||
更换相机身份、分辨率、ROI、内参、手眼结果、TCP 或平面参数后,清除当前锁定图像、目标点和待执行路径,并重新确认必要条件。标定结果按服务器、机器人和相机身份过滤;相同设备 ID 下换了硬件也不能静默沿用旧结果。
|
||||
|
||||
旧标定文件缺少相机序列号时显示为需确认匹配,不能自动绑定给新设备。改变镜头、焦距或成像模式后重新校验内参。程序重启可恢复配置选择,但不恢复旧图像和待执行动作。
|
||||
|
||||
## 三轴力传感器扩展边界
|
||||
|
||||
本阶段只预留状态区域和接口契约,默认“未接入”,不生成假力值,不启用力控运动。
|
||||
|
||||
后续设备适配必须提供传感器身份、绑定机械臂、Fx/Fy/Fz(N)、有效标志、采集时间、坐标系、传感器到工具的安装变换、量程和故障。三轴力不包含 Tx/Ty/Tz,缺失力矩不能显示成已测得的零值。
|
||||
|
||||
接入后可扩展接触确认、按压阈值与侧向力限制。传感器只能提供接触反馈,不能替代二维相机缺失的目标空间位置。加装传感器改变工具安装尺寸时需重新 TCP 标定;若同时改变相机与法兰的相对安装,则还需重新手眼标定。
|
||||
|
||||
接触停止及闭环控制应在能够保证时效的服务端或控制器实现,Qt 负责参数与状态显示。传感器型号、通讯协议、更新频率尚未给出,真实驱动与力控不纳入本次交付。
|
||||
|
||||
## 涉及文件与验证
|
||||
|
||||
协议:Qt 和服务端的 camera_command.proto、camera_config.proto 同步兼容扩展。
|
||||
|
||||
服务端:AbstractCamera、GetStatus、CameraFactory、独立 MVS 驱动及可选 SDK 构建配置。保留现有驱动和流资源管理行为。
|
||||
|
||||
Qt:RobotClient 能力查询与会话校验、MainWindow 页面同步、现有手眼和末端页面、平面配置与 TouchPlanner 调用。Qt 5.12.4 和现有 C++ 标准保持不变。
|
||||
|
||||
验证:能力缺失及旧服务兼容、单相机替换与自动模式切换、旧采集资源释放、没有相机或发现不唯一、断线和旧回包、身份与内参不匹配、二维射线求交、深度模式回归、配置重载、点击像素比例,以及 UI 与主程序编译。实机检查分别验证 MVS 采集和 RealSense 回归;自动化测试不发送机械臂运动指令。
|
||||
|
||||
尚未解决的“读数变化但机械臂未实际运动”问题不能被新模式掩盖;在真实触控验证前需独立确认运动反馈来自真实控制器。
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,118 +0,0 @@
|
||||
{
|
||||
"executionPolicy": {
|
||||
"automaticRetry": false,
|
||||
"onError": "stop",
|
||||
"order": "sequential",
|
||||
"stopBehavior": "stop_scheduling_and_cancel_active_unary",
|
||||
"waitStartsAfter": "operation_success"
|
||||
},
|
||||
"format": "cmvr.task-flow",
|
||||
"groups": [
|
||||
{
|
||||
"id": "example-group",
|
||||
"name": "offline example",
|
||||
"nodes": [
|
||||
{
|
||||
"action": "接口 · ApplyUserCoordinateSystem",
|
||||
"deviceId": "aubo_arm",
|
||||
"deviceType": "机械臂",
|
||||
"execution": {
|
||||
"completion": "rpc_response",
|
||||
"kind": "grpc_unary",
|
||||
"method": "ApplyUserCoordinateSystem",
|
||||
"request": {
|
||||
"expected_revision": "0",
|
||||
"header": {
|
||||
"device_id": "aubo_arm"
|
||||
},
|
||||
"name": "测试坐标系"
|
||||
},
|
||||
"service": "cmvr.api.ArmService",
|
||||
"timeoutMs": 180000
|
||||
},
|
||||
"id": "example-apply",
|
||||
"kind": "task",
|
||||
"name": "接口 · ApplyUserCoordinateSystem",
|
||||
"operationId": "cmvr.api.ArmService.ApplyUserCoordinateSystem",
|
||||
"parameters": {
|
||||
"method": "ApplyUserCoordinateSystem",
|
||||
"request": {
|
||||
"expected_revision": "0",
|
||||
"name": "测试坐标系"
|
||||
},
|
||||
"service": "cmvr.api.ArmService",
|
||||
"timeoutMs": 180000
|
||||
},
|
||||
"waitMs": 3000,
|
||||
"waitUnit": "s"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"action": "接口 · moveL",
|
||||
"deviceId": "aubo_arm",
|
||||
"deviceType": "机械臂",
|
||||
"execution": {
|
||||
"completion": "rpc_response",
|
||||
"kind": "grpc_unary",
|
||||
"method": "moveL",
|
||||
"request": {
|
||||
"header": {
|
||||
"device_id": "aubo_arm"
|
||||
},
|
||||
"options": {
|
||||
"acceleration": 0.5,
|
||||
"velocity": 0.1
|
||||
},
|
||||
"target": {
|
||||
"rx": 0,
|
||||
"ry": 0,
|
||||
"rz": 0,
|
||||
"x": 0.1,
|
||||
"y": 0.2,
|
||||
"z": 0.3
|
||||
},
|
||||
"user_coordinate_name": "测试坐标系",
|
||||
"user_coordinate_revision": "0"
|
||||
},
|
||||
"service": "cmvr.api.ArmService",
|
||||
"timeoutMs": 180000
|
||||
},
|
||||
"id": "example-movej-pose",
|
||||
"kind": "task",
|
||||
"name": "接口 · moveL",
|
||||
"operationId": "cmvr.api.ArmService.moveL",
|
||||
"parameters": {
|
||||
"method": "moveL",
|
||||
"request": {
|
||||
"options": {
|
||||
"acceleration": 0.5,
|
||||
"velocity": 0.1
|
||||
},
|
||||
"target": {
|
||||
"rx": 0,
|
||||
"ry": 0,
|
||||
"rz": 0,
|
||||
"x": 0.1,
|
||||
"y": 0.2,
|
||||
"z": 0.3
|
||||
},
|
||||
"user_coordinate_name": "测试坐标系",
|
||||
"user_coordinate_revision": "0"
|
||||
},
|
||||
"service": "cmvr.api.ArmService",
|
||||
"timeoutMs": 180000
|
||||
},
|
||||
"waitMs": 3000,
|
||||
"waitUnit": "s"
|
||||
}
|
||||
],
|
||||
"count": 2,
|
||||
"id": "example-loop",
|
||||
"kind": "loop",
|
||||
"name": "repeat"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,142 +0,0 @@
|
||||
// Transport-independent reference. No connection or device command is made on import.
|
||||
export const executionPolicy = Object.freeze({order:'sequential',onError:'stop',automaticRetry:false,
|
||||
waitStartsAfter:'operation_success',stopBehavior:'stop_scheduling_and_cancel_active_unary'});
|
||||
const equal=(a,b)=>canonical(a)===canonical(b);
|
||||
function canonical(v){return JSON.stringify(Array.isArray(v)?v.map(sort):sort(v));}
|
||||
function sort(v){if(Array.isArray(v))return v.map(sort);if(v&&typeof v==='object')return Object.fromEntries(Object.keys(v).sort().map(k=>[k,sort(v[k])]));return v;}
|
||||
const object=v=>v!==null&&typeof v==='object'&&!Array.isArray(v);
|
||||
function check(ok,message){if(!ok)throw new Error(message);}
|
||||
function integer(v,min,max){return Number.isInteger(v)&&v>=min&&v<=max;}
|
||||
|
||||
export function validateMessage(value,type,catalog,depth=0){
|
||||
check(depth<=32,'Message nesting exceeds 32');
|
||||
if(type==='google.protobuf.Timestamp'){check(typeof value==='string'&&!Number.isNaN(Date.parse(value)),'Invalid Timestamp');return;}
|
||||
if(type==='google.protobuf.Duration'){check(typeof value==='string'&&/^-?\d+(\.\d{1,9})?s$/.test(value),'Invalid Duration');return;}
|
||||
check(object(value),`Expected message ${type}`);const message=catalog.messages[type];check(message,`Unknown message ${type}`);
|
||||
const seen=new Set(),oneofs=new Set();
|
||||
function scalar(v,f){
|
||||
if(f.messageType){validateMessage(v,f.messageType,catalog,depth+1);return;}
|
||||
if(f.enumType){check((catalog.enums[f.enumType]||[]).some(e=>e.name===v||e.number===v),`Invalid enum ${f.name}`);return;}
|
||||
if(f.type==='string'){check(typeof v==='string',`Invalid string ${f.name}`);return;}
|
||||
if(f.type==='bytes'){check(typeof v==='string'&&/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(v),`Invalid Base64 ${f.name}`);return;}
|
||||
if(f.type==='bool'){check(typeof v==='boolean',`Invalid boolean ${f.name}`);return;}
|
||||
if(['int64','sint64','sfixed64','uint64','fixed64'].includes(f.type)){
|
||||
check(typeof v==='string'&&/^-?\d+$/.test(v),`Use a decimal string for ${f.name}`);
|
||||
const number=BigInt(v),unsigned=f.type==='uint64'||f.type==='fixed64';
|
||||
check(number>=(unsigned?0n:-(1n<<63n))&&number<=(unsigned?(1n<<64n)-1n:(1n<<63n)-1n),`64-bit overflow ${f.name}`);return;
|
||||
}
|
||||
check(typeof v==='number'&&Number.isFinite(v),`Invalid number ${f.name}`);
|
||||
if(!['float','double'].includes(f.type)){const unsigned=f.type==='uint32'||f.type==='fixed32';check(integer(v,unsigned?0:-2147483648,unsigned?4294967295:2147483647),`32-bit overflow ${f.name}`);}
|
||||
}
|
||||
for(const [key,v] of Object.entries(value)){
|
||||
const f=message.fields.find(f=>f.name===key||f.jsonName===key);check(f,`Unknown field ${type}.${key}`);
|
||||
check(!seen.has(f.name),`Duplicate field alias ${key}`);seen.add(f.name);
|
||||
if(f.oneof){check(!oneofs.has(f.oneof),`Mutually exclusive fields in ${f.oneof}`);oneofs.add(f.oneof);}
|
||||
if(f.map){
|
||||
check(object(v),`Map must be an object: ${key}`);const fields=catalog.messages[f.messageType].fields,keyField=fields.find(f=>f.name==='key'),entry=fields.find(f=>f.name==='value');
|
||||
for(const [k,item] of Object.entries(v)){
|
||||
const mapKey=keyField.type==='bool'?(k==='true'?true:k==='false'?false:k):keyField.type==='string'||keyField.type.includes('64')?k:Number(k);
|
||||
scalar(mapKey,keyField);scalar(item,entry);
|
||||
}
|
||||
}else if(f.repeated){check(Array.isArray(v),`List required ${key}`);for(const item of v)scalar(item,f);}
|
||||
else scalar(v,f);
|
||||
}
|
||||
}
|
||||
|
||||
// Validate the entire plan before executing the first node. Returned order is authoritative.
|
||||
export function flatten(document,catalog,groupId){
|
||||
check(document.format==='cmvr.task-flow'&&!Object.hasOwn(document,'version'),'Expected cmvr.task-flow without version; normalize legacy files using Qt');
|
||||
check(equal(document.executionPolicy,executionPolicy),'Unsupported execution policy');
|
||||
check(Array.isArray(document.groups),'groups must be an array');const ids=new Set(),result=new Map();
|
||||
const methods=new Map(catalog.services.flatMap(s=>s.methods.map(m=>[m.id,{...m,deviceType:s.deviceType}])));
|
||||
const adapters=new Map(catalog.clientAdapters.map(a=>[a.id,a]));
|
||||
const identify=n=>{check(typeof n.id==='string'&&n.id&&!ids.has(n.id),'Missing or duplicate id');ids.add(n.id);};
|
||||
function visit(nodes,depth){
|
||||
check(depth<=32&&Array.isArray(nodes),'Invalid children or excessive nesting');const steps=[];
|
||||
for(const node of nodes){
|
||||
check(object(node),'Node must be an object');identify(node);
|
||||
if(node.kind==='loop'){
|
||||
check(integer(node.count,1,100000)&&Array.isArray(node.children)&&node.children.length>0,'Invalid repeat count or empty loop');const children=visit(node.children,depth+1);
|
||||
check(steps.length+children.length*node.count<=100000,'Expanded plan exceeds 100000 steps');
|
||||
for(let iteration=0;iteration<node.count;iteration++)for(const entry of children)steps.push({node:entry.node,iterationPath:[{loopId:node.id,iteration},...entry.iterationPath]});
|
||||
check(integer(node.waitMs??0,0,2147483647),'Invalid loop post-completion delay');
|
||||
if(node.waitMs){const last=steps.at(-1);const waitMs=last.node.waitMs+node.waitMs;check(integer(waitMs,0,2147483647),'Accumulated delay exceeds limit');last.node={...last.node,waitMs};}
|
||||
}else{
|
||||
check(node.kind==='task'&&typeof node.deviceId==='string'&&node.deviceId,'Invalid task or deviceId');
|
||||
check(integer(node.waitMs,0,2147483647)&&['ms','s'].includes(node.waitUnit),'Invalid post-completion delay');
|
||||
const ex=node.execution,p=node.parameters;check(object(ex)&&object(p),'Missing execution or parameters');
|
||||
if(ex.kind==='grpc_unary'){
|
||||
const m=methods.get(node.operationId);check(m&&!m.clientStreaming&&!m.serverStreaming,'Unknown or streaming operation');
|
||||
check(m.service===ex.service&&m.method===ex.method&&p.service===m.service&&p.method===m.method,'Conflicting RPC identity');
|
||||
check(node.deviceType==='通用RPC'||(node.deviceType===m.deviceType&&node.action===`接口 · ${m.method}`),'Conflicting display action/device type');
|
||||
check(integer(ex.timeoutMs,100,1800000)&&ex.timeoutMs===(p.timeoutMs??180000),'Invalid RPC timeout');
|
||||
const expected=structuredClone(p.request||{}),fields=catalog.messages[m.requestType].fields;
|
||||
if(fields.some(f=>f.name==='header')){expected.header={...expected.header,device_id:node.deviceId};delete expected.header.deviceId;}
|
||||
else if(fields.some(f=>f.name==='device_id')){delete expected.deviceId;expected.device_id=node.deviceId;}
|
||||
check(ex.completion==='rpc_response'&&equal(expected,ex.request),'Conflicting RPC payload');validateMessage(ex.request,m.requestType,catalog);
|
||||
}else{
|
||||
const a=adapters.get(node.operationId);check(ex.kind==='client_adapter'&&a&&ex.adapter===a.id,'Unknown client adapter');
|
||||
check(a.deviceType===node.deviceType&&a.action===node.action&&ex.deviceId===node.deviceId&&equal(p,ex.parameters)&&ex.completion==='adapter_callback','Conflicting adapter payload');
|
||||
}
|
||||
steps.push({node,iterationPath:[]});check(steps.length<=100000,'Expanded plan exceeds 100000 steps');
|
||||
}
|
||||
}return steps;
|
||||
}
|
||||
for(const group of document.groups){identify(group);result.set(group.id,visit(group.nodes,0));}
|
||||
check(result.has(groupId),'Group not found');check(result.get(groupId).length>0,'No executable tasks');return result.get(groupId);
|
||||
}
|
||||
function succeeded(response){
|
||||
const header=response?.header??response;
|
||||
check(header?.success===true,header?.error_message||header?.errorMessage||'Missing/false business success');
|
||||
return response;
|
||||
}
|
||||
function delay(ms,signal){return new Promise((resolve,reject)=>{
|
||||
if(signal?.aborted){reject(new Error('Canceled'));return;}
|
||||
const abort=()=>{clearTimeout(timer);reject(new Error('Canceled'));};
|
||||
const timer=setTimeout(()=>{signal?.removeEventListener('abort',abort);resolve();},ms);
|
||||
signal?.addEventListener('abort',abort,{once:true});
|
||||
});}
|
||||
|
||||
// Inject transport/adapters. The reference has no built-in gRPC-Web connection.
|
||||
// rpc(service,method,request,{signal,timeoutMs}) => Promise<decoded Protobuf-JSON response>
|
||||
// adapters[id](parameters,{deviceId,signal}) => Promise<{success:true,...}>
|
||||
export async function execute(document,catalog,groupId,{rpc,adapters={},signal,onEvent=()=>{}}){
|
||||
const steps=flatten(document,catalog,groupId);
|
||||
for(const {node} of steps)if(node.execution.kind==='client_adapter')check(typeof adapters[node.execution.adapter]==='function',`Missing adapter ${node.execution.adapter}`);
|
||||
for(let index=0;index<steps.length;index++){
|
||||
const {node,iterationPath}=steps[index],context={nodeId:node.id,index,iterationPath};let timer,detach=()=>{};
|
||||
try{
|
||||
check(!signal?.aborted,'Canceled');onEvent({...context,state:'running'});const ex=node.execution;let response;
|
||||
if(ex.kind==='grpc_unary'){
|
||||
check(typeof rpc==='function','RPC transport required');const controller=new AbortController();
|
||||
const canceled=()=>controller.abort();signal?.addEventListener('abort',canceled,{once:true});detach=()=>signal?.removeEventListener('abort',canceled);
|
||||
const request=structuredClone(ex.request),m=catalog.services.flatMap(s=>s.methods).find(m=>m.id===node.operationId);
|
||||
const nested=catalog.messages[m.requestType].fields.some(f=>f.name==='header');const h=nested?(request.header??={}):request;
|
||||
delete h.commandId;h.command_id=globalThis.crypto.randomUUID();h.timestamp=new Date().toISOString();
|
||||
const interrupted=new Promise((_,reject)=>controller.signal.addEventListener('abort',()=>reject(new Error('Canceled or deadline exceeded; physical stop not confirmed')),{once:true}));
|
||||
timer=setTimeout(()=>controller.abort(),ex.timeoutMs);
|
||||
if(ex.service==='cmvr.api.ArmService'&&ex.method==='moveL'&&
|
||||
(request.user_coordinate_name||request.userCoordinateName||'user_frame_pose' in request||'userFramePose' in request||'tcp_offset' in request||'tcpOffset' in request)){
|
||||
let probeTimer;
|
||||
try{
|
||||
const probe=await Promise.race([rpc(ex.service,'ExecuteJsonCommand',{header:{device_id:node.deviceId},request_json:'{"command":"get_active_tcp_offset"}'},{signal:controller.signal,timeoutMs:3000}),interrupted,
|
||||
new Promise((_,reject)=>{probeTimer=setTimeout(()=>reject(new Error('Coordinate capability probe timed out; no motion sent')),3000);})]);
|
||||
succeeded(probe);const capability=JSON.parse(probe.response_json??probe.responseJson??'{}');
|
||||
check(capability.coordinate_api_version>=4&&capability.movel_target_mode==='absolute_selected_frame','Absolute selected-frame MoveL unsupported; no motion sent');
|
||||
}finally{clearTimeout(probeTimer);}
|
||||
}
|
||||
response=await Promise.race([Promise.resolve().then(()=>rpc(ex.service,ex.method,request,{signal:controller.signal,timeoutMs:ex.timeoutMs})),interrupted]);
|
||||
}else {
|
||||
const interrupted=new Promise((_,reject)=>{
|
||||
const abort=()=>reject(new Error('Canceled; adapter/device stop not confirmed'));
|
||||
signal?.addEventListener('abort',abort,{once:true});detach=()=>signal?.removeEventListener('abort',abort);
|
||||
});
|
||||
response=await Promise.race([Promise.resolve().then(()=>adapters[ex.adapter](structuredClone(ex.parameters),{deviceId:node.deviceId,signal})),interrupted]);
|
||||
}
|
||||
clearTimeout(timer);detach();succeeded(response);check(!signal?.aborted,'Canceled');
|
||||
onEvent({...context,state:'succeeded',response});
|
||||
if(node.waitMs){onEvent({...context,state:'waiting',waitMs:node.waitMs});await delay(node.waitMs,signal);}
|
||||
}catch(error){clearTimeout(timer);detach();onEvent({...context,state:signal?.aborted?'canceled':'failed',error:String(error)});throw error;}
|
||||
}
|
||||
onEvent({state:'completed',completedSteps:steps.length});return {success:true,completedSteps:steps.length};
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,158 +0,0 @@
|
||||
CMVR 任务编排 JSON —— 外部解析与执行协议
|
||||
2026-11-10
|
||||
|
||||
一、交付范围
|
||||
本包定义一份可由Qt上位机和外部程序共同理解的任务文件。它不是网页项目,不包含云端同步服务或gRPC-Web网关。外部可导入同一文件,绘制节点、生成参数表单、按本协议实现执行器。
|
||||
当前界面入口:任务编排 -> 添加任务 -> 选择已连接设备 -> 选择操作。
|
||||
保留原有友好操作,额外提供“接口 · 方法名”。本次构建按Proto覆盖8类设备服务的120个Unary接口,完整清单见task_operations.json。
|
||||
原有接口是否真正支持某型号、是否需要上电/使能及相关参数限制,以服务端驱动和反馈为准。目录列出接口不代表每台设备都支持全部功能,不自动启用设备,也不自动使能。
|
||||
|
||||
文件说明:
|
||||
- example.task.json:Qt核心格式代码生成的完整示例,含坐标系应用和循环内末端位姿MoveJ。目标只是示例值,不能作为现场运动目标。
|
||||
- task-flow.schema.json:JSON Schema Draft 2020-12;涵盖节点、执行字段及120个Unary接口的请求消息类型。
|
||||
- task_operations.json:操作目录、请求/反馈消息、枚举及38个客户端适配节点的参数规则与实现说明。
|
||||
- verify-example.mjs:用Node运行的离线自检:node verify-example.mjs;仅模拟传输,不连接设备。
|
||||
- task-flow.mjs:无连接代码的JavaScript参考解析/执行器,运行时由外部注入rpc和媒体等适配函数。
|
||||
- protos/:原始Proto及递归依赖,字段含义和单位以对应注释为准。相同数值字段在不同接口中可能单位不同。
|
||||
- rpc_catalog.txt:按设备划分的清单,区分Unary/流式。
|
||||
|
||||
二、上位机现已实现的行为
|
||||
新增的Unary操作使用按Proto生成的参数表单:支持数字、字符串、Base64二进制、布尔、枚举、嵌套消息、列表、Map和oneof互斥字段。
|
||||
部分接口共用同一Request类型,editorFields标明当前方法实际使用的输入字段。电机设置模式、六种运动模式及限位设置分别只显示对应字段;Apply/Get/Delete坐标系不显示无关的完整coordinate记录。外部可使用editorFields渲染相同表单,完整消息字段仍在messages中保留。
|
||||
消息参数通过复选框控制是否发送;列表逐项增删;oneof只能选一个分支;可选标量可控制是否发送。64位整数按十进制字符串保存,避免JS精度损失。表单最多展开12层参数嵌套。
|
||||
通用请求头由上位机填写:device_id来自节点设备,command_id为每次调用的新UUID,timestamp为当前UTC时间;不用用户重复输入。
|
||||
新增接口在未连接或演示模式下不会发送。新增接口在独立线程执行,每节点可设置100~1800000ms的RPC超时,默认180000ms,不阻塞界面线程。
|
||||
反馈检查传输状态和业务success;失败终止后续节点,不自动重试。执行历史可双击查看/复制反馈。历史保留最近200条,单条详细反馈超过1MiB会明确截断;原始图像展示应使用专用抓图/预览节点。
|
||||
|
||||
同时修正了旧AGV停止/暂停/继续的命令映射;导航站点通过独立RPC线程等待结果。任务中的AGV新调用复用手动控制与地图操作的检查,并等待已排队控制命令结束,避免先前的停止速度命令晚于导航请求到达。外部若也有手动控制通道,应实现同样的协调。
|
||||
原有方案、循环、拖动排序、节点间插入、执行后等待、图像结果窗口和音频播放等保留。录制、媒体流启动与停止依然由专用状态回调推进。
|
||||
相机专用深度抓图以及新增GetDepthImage/GetRGBDImages操作会按已获取的深度能力过滤;未获取能力时按不支持处理。外部客户端应同样检查能力,并处理服务端“不支持”反馈。
|
||||
|
||||
三、根对象
|
||||
format 固定为 cmvr.task-flow;任务文件不包含 version。Qt 兼容读取旧版 version=1/2 文件,规范化后移除 version。
|
||||
groups 是方案数组。每个方案包含:id(稳定标识)、name(显示名)、nodes(根节点有序数组)。
|
||||
executionPolicy 固定为:
|
||||
order: sequential
|
||||
onError: stop
|
||||
automaticRetry: false
|
||||
waitStartsAfter: operation_success
|
||||
stopBehavior: stop_scheduling_and_cancel_active_unary
|
||||
未知版本和不支持的策略必须拒绝,不能猜测后执行。
|
||||
|
||||
文件不保存服务器IP、凭据、robot_id和真实运行状态。外部必须单独绑定目标机器人/连接,确认deviceId属于该连接;不能仅凭同名deviceId跨机器人发送指令。
|
||||
同一任务文件中的方案和节点id必须唯一。绘图和运行日志用id关联,不能用中文名称作为主键。
|
||||
|
||||
四、节点与顺序
|
||||
kind=task:普通任务;kind=loop:循环。
|
||||
普通节点包含 id、name、deviceType、deviceId、action、operationId、parameters、execution、waitMs、waitUnit。
|
||||
deviceType/action保留上位机显示和兼容用途;operationId为稳定、机器可读的操作标识,不能只根据中文标题猜接口。
|
||||
相邻节点的执行顺序由所在nodes/children数组顺序决定;无需另存edges。上一个完整子树执行完成后再执行下一个同级节点。
|
||||
循环包含count与children:将整个children序列按count次数重复,允许嵌套。collapsed只是显示状态,折叠不跳过执行。
|
||||
最多32层嵌套、每方案展开最多100000个任务。count为1~100000整数。空循环可作为编辑草稿保存,但执行时必须拒绝;空方案不可执行。
|
||||
节点id在循环每次迭代中不改变。日志需要另外记录迭代路径和执行序号,例:[{loopId:"example-loop",iteration:0}],iteration从0开始。
|
||||
|
||||
waitMs为实际等待毫秒数,0~2147483647整数。waitUnit只影响显示,可为ms或s;例如waitMs=3000且waitUnit=s显示3s。执行器绝不能再把3000乘1000。
|
||||
等待从本节点成功条件成立后开始;等待结束才进入下一任务。不能把“完成后等待”当作接口超时或动画时长。
|
||||
|
||||
五、直接gRPC节点(新增接口)
|
||||
operationId示例:cmvr.api.ArmService.moveJPose。
|
||||
action为“接口 · moveJPose”,deviceType对应目录服务的设备类型。
|
||||
parameters包含service、method、request、timeoutMs。request为Proto-JSON;允许Proto原字段名或jsonName别名,但不能重复提供同一字段的两种写法。
|
||||
execution包含:
|
||||
kind: grpc_unary
|
||||
service: 完整服务名,如cmvr.api.ArmService
|
||||
method: 原方法名,大小写敏感
|
||||
request: 根据parameters.request生成并绑定节点deviceId的请求
|
||||
timeoutMs: RPC截止时间,默认180000ms
|
||||
completion: rpc_response
|
||||
|
||||
对普通Request消息,目标设备写入request.header.device_id;对直接使用CommandHeader.Request的接口(如torqueOn),目标设备写在request.device_id,不能再包一层header。
|
||||
request中的device_id以节点deviceId为准。发送前每次重新生成command_id和timestamp,不能将之前已执行的command_id作为自动重试标识。
|
||||
parameters与execution是同一意图的编辑视图和执行视图。修改request时必须同步重建execution;action/operationId、service/method和request若互相矛盾,必须拒绝,不允许任选其一执行。
|
||||
上位机导入会校验Proto字段、类型、互斥关系、有限数值和上述一致性;不能用NaN或Infinity,也不接受未知字段。
|
||||
JSON Schema做结构验证,跨字段一致性、id全局唯一、循环展开数量以及64位范围等仍需语义校验;task-flow.mjs提供此部分参考。
|
||||
|
||||
消息字段规则:
|
||||
- int32/uint32等为JSON整数,遵守32位范围;int64/uint64等用十进制字符串并校验64位范围。
|
||||
- double/float为有限JSON数字;bool是true/false;string为字符串;bytes是Base64。
|
||||
- enum使用目录中的枚举名称或已知整数值。
|
||||
- repeated为数组,Map为JSON对象。
|
||||
- 嵌套消息为对象。缺省消息字段可以不发送;不要把缺省和全部字段填0混为一谈。
|
||||
- google.protobuf.Timestamp使用RFC3339 UTC时间字符串。
|
||||
|
||||
六、机械臂坐标系和运动示例的准确含义
|
||||
先添加“接口 · ApplyUserCoordinateSystem”:填已保存name、expected_revision,不能把完整coordinate当应用请求;应用不运动。
|
||||
再添加“接口 · moveL”或“接口 · moveJPose”,目标均为所选坐标系下的完整绝对TCP位姿,XYZ为m,RX/RY/RZ为rad,约定RzRyRx,不是增量。
|
||||
MoveL:速度m/s,加速度m/s²;先应用坐标系,user_coordinate_name/revision校验对应当前应用,不混用base_frame/tcp_frame、显式坐标位姿或增量模式。
|
||||
末端位姿MoveJ:速度rad/s,加速度rad/s²,name必填,blend_radius=0;服务端坐标变换、SDK逆解后调用moveJoint,路径不保证直线。逆解失败不运动。
|
||||
user_coordinate_revision、expected_revision可填字符串"0"表示使用最新记录,但当前已应用版本也必须匹配。需要防止中途记录变更时,应填写查到的具体版本。
|
||||
普通关节角MoveJ传target.position,不受工件坐标系改变影响。
|
||||
|
||||
新接口路径的自定义坐标系MoveL在运动前调用ArmService.ExecuteJsonCommand做能力确认,请求request_json为 {"command":"get_active_tcp_offset"};响应response_json解析后要求coordinate_api_version>=4且movel_target_mode=absolute_selected_frame。否则拒绝运动,不能依赖旧服务端忽略未知字段后的行为。task-flow.mjs也演示此检查。
|
||||
Qt任务编排依次调用各个接口,不会将这些节点自动转换成SystemService.ExecuteActionQueue请求;“动作队列测试”仍是另一个页面和另一条服务端执行路径。
|
||||
当前205服务端运动完成等待上限是120秒。任务节点的RPC超时调大不会延长这个驱动内部上限。
|
||||
|
||||
七、旧友好节点/媒体节点
|
||||
旧节点operationId以client.开头,例如client.camera.preview_start、client.arm.move_j。
|
||||
execution.kind=client_adapter,包含adapter、deviceId、parameters,completion=adapter_callback。
|
||||
不能把adapter名字当RPC方法名调用。完整参数schema、所用RPC及成功含义在task_operations.json的clientAdapters中。
|
||||
其中部分只是已有Unary接口的友好包装;图像预览、声音采集和播放需要客户端会话、编解码及结果展示逻辑。
|
||||
预览/音频流启动节点确认流建立后就完成该节点,后续waitMs开始计时;流继续存在,直到专门的停止节点或显式关闭。不会一直等到整段流结束才执行下一节点。
|
||||
相机预览需GetStatus查询编码器再建RGB视频流。开始录像/录音不意味着录制已经结束。播放服务端文件的path是服务端路径,不是自动上传本地文件。
|
||||
本机麦克风流播放需先建立扬声器流,再采集本机PCM音频发送;浏览器端必须申请麦克风权限并提供对应媒体适配,Qt设备名不能直接当浏览器设备ID使用。
|
||||
成功回调格式为{success:true,...};失败应reject或返回success:false。适配器必须保证反馈对应当前节点和设备,而不是复用别的会话事件。
|
||||
|
||||
目录还列出8个原始流式RPC。当前专用节点覆盖RGB预览、麦克风和扬声器流;深度/RGBD视频流、AGV地图流、灵巧手传感器流、仿生头表情流目前未作为新通用节点直接开放。它们不应被当作一次性Unary调用,也不能承诺都已适配。
|
||||
|
||||
八、成功、失败、取消和结果
|
||||
直接RPC节点:传输成功且反馈header.success(或直接反馈对象success)为true才成功。缺少业务成功标志、gRPC错误或false均停止后续节点,不自动重试。
|
||||
completion=rpc_response只代表这个服务接口的返回条件。某些接口等待运动完成,某些仅表示驱动接受;重定位可能未收敛,灵巧手可能未到位,不能从Unary一词推导物理完成。
|
||||
目录中MotorRequest.mode的suggestedChoices给出轮廓位置/速度/力矩、周期位置/速度/力矩的常用数值,外部可据此渲染下拉框;支持范围仍由电机驱动决定。
|
||||
导出的目录响应消息说明返回数据结构。结果、错误和运行进度单独保存,不写回计划参数,不用结果修改已定义节点目标。当前没有跨节点变量绑定、条件分支、并发节点或失败自动恢复。
|
||||
|
||||
点击停止或连接断开时,停止安排后续节点。新通用Unary的ClientContext会被取消;旧客户端适配节点只停止流程调度,不保证主动停止所有设备/媒体会话。需要结束流、录制或设备运动,应使用相应停止节点或专门的设备停止/急停操作。
|
||||
RPC取消、客户端超时、网络断开不等于物理停止已经确认;服务端可能已经接受动作。结果不明时不能自动重发运动。
|
||||
独立执行器应预检所有节点与适配器后再发第一个动作。执行中遇到错误即结束,已经完成的动作和坐标系应用不回滚;不要因重载网页自动重跑任务。
|
||||
|
||||
九、外部实现建议流程
|
||||
1. 读取文件,检查format及JSON Schema。
|
||||
2. 加载相同版本task_operations.json,按id解析接口及请求/反馈类型;用Proto或目录构造参数表单。
|
||||
3. 做语义校验:id、循环限制、operationId与参数一致、设备归属、服务能力、适配器是否全部可用。
|
||||
4. 将目标方案深度优先展开;每次迭代保持完整子序列顺序。
|
||||
5. 新建运行上下文,按节点execution调用。rpc由外部注入连接/鉴权/gRPC-Web适配,client_adapter由外部注入媒体等逻辑。
|
||||
6. 等待对应成功条件,记录返回结果,等待waitMs,再进入下一节点。
|
||||
7. 失败/取消/超时停止,不重试、不自动恢复后续节点;由用户确认后决定下一步。
|
||||
|
||||
参考JavaScript(ES2022,浏览器或较新Node,需crypto.randomUUID/structuredClone/AbortController):
|
||||
import {execute} from './task-flow.mjs';
|
||||
const abort = new AbortController();
|
||||
await execute(plan, catalog, plan.groups[0].id, {
|
||||
rpc: async (service, method, request, {signal, timeoutMs}) => {
|
||||
// 通过你自己的gRPC/gRPC-Web客户端调用,返回解码后的Proto-JSON对象。
|
||||
// 传递取消和deadline;若使用SDK消息对象,先转成JSON,保留false的success。
|
||||
return yourTransport(service, method, request, {signal, timeoutMs});
|
||||
},
|
||||
adapters: yourClientAdapters,
|
||||
signal: abort.signal,
|
||||
onEvent: event => console.log(event)
|
||||
});
|
||||
// abort.abort()停止执行器等待/后续调度;不代表现场机械臂已停稳。
|
||||
不要将包中的示例rpc替换成真正网络传输后直接运行示例目标,先在离线/模拟环境验证解析和结果判断。
|
||||
|
||||
十、文件保存、导入导出与兼容
|
||||
Qt仍保存到程序目录data/task_orchestration.json,使用原子写入,不使用注册表。
|
||||
导出按钮生成选定文件名的整份任务文件,以及同目录task_operations.json。请将操作目录与任务文件一起交给外部开发者。
|
||||
导入会追加方案,重新生成导入方案/节点id以避免与本地冲突,不删除已有方案,不执行任何节点。
|
||||
v1旧文件会迁移到当前无 version 格式,迁移前先生成task_orchestration.json.v1.bak;同名备份已存在时生成独立UUID备份,不覆盖旧备份。
|
||||
解析失败、未知版本、无效接口参数或执行描述冲突时保留原文件、禁用自动覆盖。重新导入有效文件前会先备份原文件。
|
||||
当前协议只约定上述字段。外部自己的机器人连接绑定、云端版本、用户权限等放在外部系统中管理;不要依赖Qt保留额外的未知根字段。
|
||||
|
||||
十一、验证范围
|
||||
已完成Release编译及纯离线校验:旧格式迁移、稳定id、请求头放置、参数类型、NaN拒绝、循环数量、歧义拒绝、业务错误和外部参考执行器。
|
||||
测试仅使用本机回环模拟gRPC服务和模拟传输,没有发送任何现场设备控制指令。当前无头Qt初始化环境存在限制,未完成自动化真实窗口操作测试,也未逐个实机验证120个接口。
|
||||
|
||||
十二、网页服务端直接调用 cmvr-es 的导出约定(2026-11-16)
|
||||
导出时将普通友好动作转换为真实 Unary RPC 节点;本地编辑方案不变。operationId 使用完整服务名.方法名,parameters 保留 service、method、request、timeoutMs,execution.request 为绑定设备后的 Proto-JSON 请求。MoveJ 的 positions 转为 target.position,AGV 的 stationId/maxSpeed 转为 station_id/options.max_speed,灵巧手 values 转为 [{id:0,value:...},...],录像 path 转为 video_path,录音 path 转为 file_path,播放 path 转为 audio_path。
|
||||
预览、音频流仍保留编辑所需 client_adapter 字段,但每个节点额外导出 serverCalls。网页服务端按 serverCalls 顺序实现真实服务调用及会话控制,无需调用 Qt。每项含 service、method、rpcPath、requestType、responseType、clientStreaming、serverStreaming、mode、request。mode=unary 为一次调用,open_stream 为建立流,close_stream 为关闭 sessionKey 指定的既有流,关闭流不是再发一次同名 RPC。相机预览开始依次 GetStatus、StartCamera、GetRGBImageStream,状态响应 codec 用于解码。
|
||||
runtimeRequestFields 列出运行时才有的请求字段,如扬声器流每帧 audio;具体 AudioData 类型参见 task_operations.json/protos。客户端采集设备、sampleRate、channels 等原始配置保留在 parameters,网页端需要自己的采集源绑定。request 是请求模板,发送时重新生成 command_id 和 timestamp,不把缺少音频帧的模板当成完整播放请求。
|
||||
example.server-export.json 展示全部38个友好节点转换结果,仅用于离线解析,不可直接执行示例设备与路径。普通节点与循环的顺序、waitMs、失败停止策略不变。已有通用 RPC 节点的预检(如自定义坐标系 MoveL 能力确认)仍按本说明执行,不能只看到 service/method 就跳过预检。
|
||||
@ -1,160 +0,0 @@
|
||||
# 工具坐标系 TCP 标定迁移说明
|
||||
|
||||
## 页面和使用流程
|
||||
|
||||
实现位于 `F:\QT\CmvrControlStation`,仍使用 MainWindow 原来的工具坐标标定入口和堆栈索引 13。
|
||||
原页面是 `createCalibrationEntryPage` 创建的占位内容,没有专属 `.ui`、TCP 页面类或工具参数 CRUD。
|
||||
现在在原入口嵌入 `TcpCalibrationWidget`,遵循原工程动态创建控件的方式。
|
||||
|
||||
界面参考机械臂页面、配置编辑页和原标定占位页,复用 `styles.qss` 的 `panel`、`sectionTitle`、`mutedLabel`、`primaryButton`,以及既有表格、输入框和 QMessageBox。
|
||||
包含标定工具、活动 TCP 偏移核对、固定点采样表、结果与操作四个区域。日志通过信号接入 MainWindow::appendLog。
|
||||
页面不显示厂家名称或服务器/设备/演示状态摘要;上下文自动跟随机械臂页面当前选择。
|
||||
“标定工具”只负责新建或重新标定;实际点动使用哪个工具,由机械臂页面的工具坐标下拉框选择。
|
||||
|
||||
1. 连接真实机械臂,在机械臂页面选择设备,再进入原工具坐标标定入口。
|
||||
2. 从示教器核对服务端活动 TCP 的法兰到 TCP 偏移,在页面输入 XYZ(mm)和 RX/RY/RZ(度),勾选已核对。只有实际零偏移才可填全零。
|
||||
3. 输入本机工具名称,选择四点法、六点法 · XZ 或六点法 · XY。四点法在同一固定参考点改变姿态采集四次;六点法按下文的三个接近点和三个方向点采集。
|
||||
4. 点击 TCP 标定,检查 XYZ、每点残差和固定点 RMS。RMS 大于 2 mm 禁止保存,应重新采样。
|
||||
5. 四点法只计算平移,方向 RX/RY/RZ 手动输入。六点法计算完整平移和方向,方向字段只读,保存保留未舍入的结果。
|
||||
6. 点击保存工具。机械臂速度控制的工具坐标下拉框立即刷新并选择该工具,显示为“工具名(标定)”。同名记录需确认覆盖;清除或重新标定仅清空临时过程。
|
||||
7. 返回机械臂页面,选择“笛卡尔速度”页签,按住所选工具轴的方向按钮进行小步点动,松开即停止。
|
||||
|
||||
工具记录仍通过 QSettings 保存在本机,但按服务器地址和机械臂设备 ID 分别存储;不是所有机器人共用的列表。
|
||||
保存、覆盖、删除同步刷新速度控制下拉框。切换机器人或服务器后只加载该身份下的工具,可存在同名但不同偏移的工具。
|
||||
本机标定工具不会注册成控制器命名坐标系,而是由上位机将选中工具的目标位姿换算后发送给现有运动接口。
|
||||
|
||||
### 六点法 · XZ / XY
|
||||
|
||||
前三点保持工具尖端在同一固定点,改变法兰姿态,由 `solvePosition` 的最小二乘方程求 TCP 平移。后三点依次为方向原点、+X 方向点及 +Z(XZ)或 +Y(XY)方向点,保持法兰姿态一致。这与六次固定点采样不同;后三点不参与固定点残差计算。
|
||||
|
||||
`TcpCalibration::solveSixPoint` 先用已解出的偏移将后三个法兰位置换成 TCP 在基座下的位置,构造方向向量,保留 X 轴并对第二方向正交化,以右手定则补齐第三轴。最终 `R_flange_tool = transpose(R_base_flange_origin) * R_base_tool`,与原有 m/rad、ZYX 姿态格式一致。
|
||||
|
||||
拒绝秩不足、NaN/Inf、方向基线小于 10 mm、夹角不在 5°~175°、后三点相对方向原点姿态漂移超过 0.2°等情况。10 mm 是退化检查下限,不是精度推荐距离;实际距离依据工具、工作空间及示教条件确定,程序不自动移动机器人。固定点 RMS 大于 2 mm 仍禁止保存。
|
||||
|
||||
切换方法清空当前采样和结果,不删除已保存工具。记录增加方法字段,兼容没有该字段的历史固定点记录;加载和保存保留历史样本数量。四点法和两种六点法均使用原有按机器人隔离的存储与工具轴点动链路,计算与保存保持独立。
|
||||
|
||||
2026-10-08 更新验证:数值测试 16 项、页面/保存流程 16 项通过,覆盖 XZ/XY 合成真值、非零方向原点旋转、退化、重复方向原点、六点保存重载和旧记录兼容。
|
||||
|
||||
## 标定工具的实际点动链路
|
||||
|
||||
MainWindow::startCartesianJog → TcpJogController → RobotClient::requestTcpCalibrationPose → 新鲜真实反馈 → jogTarget → RobotClient::requestTcpJogMove → 原通道的 MoveL。
|
||||
|
||||
平移沿选中工具自身 XYZ 轴;旋转按所选工具自身轴生成目标,并保持所选 TCP 的目标位置不变:
|
||||
|
||||
```
|
||||
T_base_flange = T_base_activeTCP * inverse(T_flange_activeTCP)
|
||||
T_base_selectedTCP = T_base_flange * T_flange_selectedTCP
|
||||
T_target_selectedTCP = T_base_selectedTCP * delta_in_selected_axes
|
||||
T_target_activeTCP = T_target_selectedTCP * inverse(T_flange_selectedTCP) * T_flange_activeTCP
|
||||
```
|
||||
|
||||
发送的 frame 始终为 BASE,base_frame 为 `base`,tcp_frame 为 `tcp`;本机工具名称从不冒充控制器坐标名。
|
||||
已沿服务源码核实:当前适配驱动的 MoveL 对 `tcp` 读取并沿用当前 TCP 偏移,并等待到位后返回。
|
||||
界面姿态显示也使用原始活动 TCP 反馈换算为所选工具的位姿,禁止将命名 getPose 的结果重复换算。
|
||||
|
||||
SpeedL 只有 Base/Tool 枚举,不能携带任意标定偏移,且驱动禁止已有运动时叠加速度请求。因此标定工具采用有限 MoveL 小步循环,不宣称实现连续速度伺服。
|
||||
每步至多 2 mm 或 0.005 rad(约 0.29°),长工具进一步限制步长,使活动 TCP 的位移也不超过 2 mm。
|
||||
指令速度上限为平移 0.02 m/s、旋转输入 0.05 rad/s;每步重新读取反馈,连续按住最长 30 秒。实际平均速度还受 RPC 和到位等待影响。
|
||||
每段内部仍由控制器对活动 TCP 插补,旋转时所选尖端在段间有小量弦线近似误差;上述转换保证每个目标端点,而非承诺整条旋转轨迹绝对无偏差。
|
||||
|
||||
松开、切换工具/机械臂/服务器、离开机械臂页面、窗口失去激活、断连、停止按钮和超时均取消后续步进并请求 stopMotion。
|
||||
请求序号区分采点和点动,并丢弃旧反馈及重复完成消息。控制器已有坐标项保留原速度控制行为;选择“(标定)”项才进入这个新流程。
|
||||
每次重连必须核对活动 TCP 偏移;不要在点动过程中通过示教器切换它。当前协议没有自动读取该偏移的接口。
|
||||
程序内普通“末端位姿移动”会按指定控制器帧切换活动 TCP,因此在派发该 MoveL 前主动取消偏移确认、清空临时采样并停止本机 TCP 点动。
|
||||
通用 RPC 页的机械臂写命令同样使确认失效,之后需重新核对;这不会删除已保存的工具记录。
|
||||
|
||||
## phone 算法与坐标定义
|
||||
|
||||
直接参考的源码:
|
||||
|
||||
- `F:\phone\scripts\handeye_calibration_gui.py`:`aubo_pose_to_matrix`、`solve_tcp_offset`、`capture_tcp_sample`、`confirm_tcp`、`save_tcp` / `load_tcp`。
|
||||
- `F:\phone\scripts\robot_backend.py`:`flange_pose` 和 `tool_pose` 的刚体变换关系。
|
||||
|
||||
输入至少 4 个基座到法兰位姿,格式 `[x,y,z,rx,ry,rz]`,内部使用 m/rad。
|
||||
角度为 ZYX 欧拉角,旋转矩阵 `Rz(rz) * Ry(ry) * Rx(rx)`;不是旋转向量。
|
||||
齐次矩阵使用列向量约定,C++ 数组按行存储。
|
||||
|
||||
固定点方程为 `R_i * t_flange_tcp + p_i = p_fixed`。
|
||||
与 phone 一样构造 `[R_i, -I] * [t_flange_tcp; p_fixed] = -p_i`,求六个未知量的最小二乘解。
|
||||
用轻量一侧 Jacobi SVD 实现对应求解,避免引入 NumPy/Eigen 或使用正规方程放大病态误差。
|
||||
检查秩、非有限值和病态条件数;保留 phone 的毫米 RMS 和 2 mm 合格上限。
|
||||
RMS 为所有重建固定点到拟合固定点的欧氏距离的均方根,并显示每点误差。
|
||||
phone 的重复采点阈值为位移小于 1 mm 且姿态差小于 3°;Qt 对其他所有已采点进行该检查。
|
||||
|
||||
数值模块集中提供 `poseMatrix`、`matrixPose`、`flangePose`、`toolPose`;显示转换集中为 m↔mm、rad↔degree。
|
||||
对带旋转的活动偏移严格使用:
|
||||
|
||||
```
|
||||
T_base_flange = T_base_activeTCP * inverse(T_flange_activeTCP)
|
||||
T_base_localTCP = T_base_flange * T_flange_localTCP
|
||||
```
|
||||
|
||||
## 真实反馈调用链及限制
|
||||
|
||||
页面 captureRequested → RobotClient::requestTcpCalibrationPose → 既有工作线程 getTcpCalibrationPose → 既有 gRPC 通道的 GetArmInfo 和 getRobotState → state.actual_tcp_pose。
|
||||
没有创建新连接,没有使用遥测显示缓存,也不接受演示模式数据。
|
||||
|
||||
先核对返回的设备 ID 和 AUBO 驱动,再检查连接、运动、故障、停止标志、安全模式、机器人模式、反馈字段、DOF、关节位置/速度和所有数值。
|
||||
每次 RPC 有截止时间,页面另有 6 秒超时和请求序号。断连、换设备、换服务器、清除及重采均使旧响应失效。
|
||||
|
||||
已检查服务源码:命名 getPose 的驱动实现忽略帧参数,不能把它当作法兰反馈;getPoseMatrix 未实现。
|
||||
当前没有读取活动 TCP 偏移的 RPC,因此按 phone 的 gRPC 方式换算,要求用户手动确认当前偏移。采点过程中不得在示教器切换活动 TCP。
|
||||
仅对已核实的 AUBO 姿态定义开放采点,其他厂家明确报错,未猜测 Huayan 姿态约定。
|
||||
|
||||
服务端可能用全零位姿/关节数组掩盖 SDK 读取异常,客户端拒绝这些反馈;真实全零关节姿态也会被保守拒绝,可换姿态重试。
|
||||
服务端默认时间戳可能为零,因此客户端记录本次请求时间,不声称验证了硬件时间戳的新鲜度。
|
||||
没有服务端独立的 SDK 有效性标志,客户端无法完全排除服务器返回表面合法但过时的数据;实际机器人联调尚未完成。
|
||||
|
||||
## 保存和重新加载
|
||||
|
||||
工程和服务只有 TCP 名称列表,没有可调用的 TCP 偏移创建/编辑/删除/保存 RPC,也没有对应工具参数配置结构。
|
||||
按用户明确确认的方案,沿用工程默认 QSettings 增加独立的本机工具记录;没有新增文件型配置系统或控制器 Tool ID。
|
||||
名称作为当前服务器和设备下的唯一标识,记录偏移六元组(m/rad)、RMS(mm)、采样数量和当前本机工具名称。
|
||||
|
||||
Windows 默认位置:
|
||||
|
||||
```
|
||||
HKEY_CURRENT_USER\Software\CMVR\CMVR Control Station
|
||||
tcpCalibration/v1/<SHA256(endpoint + NUL + deviceId)>
|
||||
```
|
||||
|
||||
记录内同时存储服务器和设备身份,避免跨设备混用。应用启动后恢复相同连接参数和设备 ID,即加载该身份下的工具列表及当前工具;也可点击重新加载。
|
||||
保存调用 sync 并检查状态;配置损坏、同名冲突、数值异常和写入失败均报告,不静默覆盖坏配置。
|
||||
保留一个明确 TODO:待服务提供真实持久化 TCP RPC 后再接入控制器,当前不虚构接口。
|
||||
|
||||
## 文件范围
|
||||
|
||||
修改:
|
||||
|
||||
- `src/mainwindow.cpp/.h`、`src/mainwindow_ui.cpp`:原页面内容、信号槽、上下文、工具列表及点动接入。
|
||||
- `src/robotclient.h`、`src/robotclient.cpp`:通过原工作线程增加真实采点请求和校验。
|
||||
- `CmvrControlStation.pro`、`CMakeLists.txt`:登记新增模块。
|
||||
|
||||
新增:
|
||||
|
||||
- `src/tcpcalibration.h/.cpp`:数值求解和刚体转换。
|
||||
- `src/tcpcalibrationwidget.h/.cpp`:原入口内的界面与采样状态管理。
|
||||
- `src/tcptoolstore.h/.cpp`:QSettings 本机工具保存、加载、选择、删除。
|
||||
- `src/tcpjogcontroller.h/.cpp`:可取消的真实反馈读取与有限运动状态机。
|
||||
- `tests/tcpcalibration_test.cpp/.pro`、`tests/tcpworkflow_test.cpp/.pro`:算法和页面/保存流程测试。
|
||||
- `tests/tcpjog_test.cpp/.pro`:工具轴、旋转端点、停止/切换和响应隔离测试。
|
||||
- `tests/tcpintegration_test.cpp`、`tests/run_tcp_integration.py`:实际 MainWindow + RobotClient 与回环 gRPC 模拟服务联调。
|
||||
- 本说明及 `docs/superpowers/plans/2026-09-30-tcp-calibration.md`。
|
||||
|
||||
原有 protoc 路径修复、证书以及 Qt Creator 本机设置保留,属于此前环境修复,不是 TCP 算法改动。
|
||||
|
||||
## 验证
|
||||
|
||||
Qt 5.12.4、MinGW 7.3 64 位、C++14;未升级工程标准或引入数学依赖。
|
||||
算法测试 12 项通过(含初始化/清理),覆盖已知真值、phone NumPy 参考结果、退化、病态、NaN/Inf、旋转和法兰转换。
|
||||
页面/持久化测试 13 项通过(含初始化/清理),覆盖采集计算保存重开、隔离、重复/非法反馈、失败重采、旧响应、切换设备、断连、误差超限及设置写入失败。
|
||||
点动测试 7 项通过(含初始化/清理),覆盖工具轴、带旋转源偏移的 TCP 端点保持、松开后旧响应、切换及失败停止。
|
||||
回环 gRPC 联调通过:保存结果进入真实主界面下拉框;不同机器人/服务器工具隔离;真实 MoveL 请求的设备、帧和目标位姿正确;松开和切换后不继续派发运动;普通 MoveL/机械臂 RPC 派发前取消旧活动 TCP 确认。
|
||||
页面截图来自合成测试数据,不是真实机械臂测量。
|
||||
|
||||
Windows Qt 5.12.4 离屏插件不能处理 QMessageBox 的原生系统菜单;仅测试代码跳过该 Show 钩子,保留标准弹窗按钮和返回值。产品代码仍使用正常 QMessageBox。
|
||||
完整应用 qmake Debug 目标编译成功,启用 gRPC 和 MsQuic。当前旧程序正在运行,默认 exe 无法覆盖,故用同一组完整对象链接为 `bin/debug/CmvrControlStation_tcp_preview.exe`,未结束用户进程。
|
||||
构建日志为 `build/Desktop_Qt_5_12_4_MinGW_64_bit_Debug/tcp-integration-build.log`;回环联调日志为 `build/tcp-integration-test.log`。
|
||||
关闭旧程序后,Qt Creator 正常构建即可生成默认名称的新版程序。
|
||||
CMake 仅同步源文件清单,未单独执行 CMake 构建。
|
||||
真实设备采点精度、示教器偏移一致性和最终运动使用需现场验证。
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 6.9 KiB |
@ -1,5 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<rect x="2" y="2" width="60" height="60" rx="15" fill="#1b6ef3"/>
|
||||
<path d="M44 21a17 17 0 1 0 0 22" fill="none" stroke="#ffffff" stroke-width="7" stroke-linecap="round"/>
|
||||
<rect x="43" y="28" width="9" height="9" rx="3" fill="#8fddff"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 310 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 20h9"/><path d="M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4Z"/></svg>
|
||||
|
Before Width: | Height: | Size: 264 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 5v14"/><path d="M5 12h14"/></svg>
|
||||
|
Before Width: | Height: | Size: 228 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><path d="m9 3-1 3-3 1-2 3 2 2-1 3 3 2 3-1 2 2 3-1 1-3 3-1 1-3-2-2V5l-3-1-2 1-2-2Z"/><circle cx="11.5" cy="10.5" r="3"/></svg>
|
||||
|
Before Width: | Height: | Size: 309 B |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M19 6l-1 14H6L5 6"/><path d="M10 11v5"/><path d="M14 11v5"/></svg>
|
||||
|
Before Width: | Height: | Size: 298 B |
@ -1,33 +0,0 @@
|
||||
# Bundled robot models
|
||||
|
||||
The control station discovers `*.urdf` files below this directory recursively
|
||||
and lists them in the arm page's model selector. Keep a model's mesh directory
|
||||
beside its URDF package so `package://` and relative mesh references continue to
|
||||
resolve after deployment.
|
||||
|
||||
## Sources
|
||||
|
||||
- `aubo_description`: <https://github.com/AuboRobot/aubo_description>, commit
|
||||
`47fa5e02fa873f27f7e812d31f31e3f4cf5e56b1` (`main`). The upstream URDF,
|
||||
README, package metadata, and all available visual meshes referenced by those
|
||||
URDFs are preserved.
|
||||
- `elfin_model`: <https://github.com/huayan-robotics/elfin_model>, commit
|
||||
`84baf18d37eefa46b6f092c7fa1f105f81f70ecb` (`main`). The original ROS 1
|
||||
Xacro files are preserved in `xacro_source`. Files in `urdf` are standalone
|
||||
URDFs generated from them for this application's non-Xacro parser. Gazebo and
|
||||
transmission includes are intentionally omitted because they are not part of
|
||||
the source repository and are not needed by the 3D viewer.
|
||||
- `xiaoyan_description`: `SmartBench/cmvr-es`, commit
|
||||
`ed9df8fd31d8467a6119e2267edaefc43193b91e` (`dev`), directory
|
||||
`model/xiaoyan_description`. The four URDFs and their STL meshes are bundled;
|
||||
simulator-only XML and USD payloads are omitted.
|
||||
|
||||
Collision-only and otherwise unreferenced mesh files are omitted because the
|
||||
control station renders each URDF's `visual` geometry only. A small number of
|
||||
AUBO descriptions reference visual files that are already absent from the
|
||||
upstream revision; those models still load their available geometry and report
|
||||
the missing files in the application log.
|
||||
|
||||
Upstream projects did not include standalone license files at these revisions.
|
||||
Consult each source repository before redistributing the model assets outside
|
||||
this project.
|
||||
@ -1,211 +0,0 @@
|
||||
<div align="center">
|
||||
<h1 align="center">aubo_description</h1>
|
||||
<h3 align="center">
|
||||
机器人模型描述仓库
|
||||
</h3>
|
||||
</div>
|
||||
|
||||
本仓库集中维护所有 `ARCS` 软件支持的所有机器人模型。
|
||||
|
||||
## 机器人型号完备描述
|
||||
|
||||
| 项目 | 类型 | 用途 | 存储路径 | 必要性 | 示例 |
|
||||
| ---------- | --------- | ------------------------------------------------------------ | ------------------------------------- | ------ | ------------------------------------------------------------ |
|
||||
| 机器人型号 | 字符串 | 机器人型号统一定义 | | 必须 | `aubo_i5` |
|
||||
| `urdf`文件 | 文本文件 | 算法加载机器人模型 | `urdf/<robot_type>.urdf` | 必须 | [`urdf/aubo_i5.urdf`](urdf/aubo_i5.urdf) |
|
||||
| `srdf`文件 | 文本文件 | | `urdf/<robot_type>.srdf` | | [`urdf/aubo_i5.srdf`](urdf/aubo_i5.srdf) |
|
||||
| 碰撞模型 | `STL`文件 | 碰撞检测算法 | `meshes/<robot_type>/collision/*.STL` | 必须 | [`meshes/aubo_i5/collision/base_link.STL`](meshes/aubo_i5/collision/base_link.STL) |
|
||||
| 显示模型 | `3ds`文件 | 示教器显示 | `meshes/<robot_type>/visual/*.3ds` | 必须 | [`meshes/aubo_i5/visual/base.3ds`](meshes/aubo_i5/visual/base.3ds) |
|
||||
| 配置文件 | 文本文件 | 机器人型号扩展描述,对`urdf`的补充,如机器人初始位姿、打包位姿、默认速度加速度 | `config/<robot_type>.conf` | 必须 | [`config/aubo_i5.conf`](config/aubo_i5.conf) |
|
||||
|
||||
## 机器人型号规范
|
||||
|
||||
```shell
|
||||
<机器人系列代码><机器人负载><机器人系列扩展代码>-<机器人版本升级或定制代码>
|
||||
|
||||
# i5
|
||||
# i5L
|
||||
# i5RS
|
||||
# i20-1650
|
||||
```
|
||||
|
||||
### 1. 机器人系列代码
|
||||
|
||||
一般为**单个小写字母**,指代机器人的应用行业,必须
|
||||
|
||||
i - industry: 工业
|
||||
g - gaoxingneng? 未知
|
||||
f - <> 未知
|
||||
c - consume: 消费
|
||||
e - education: 教育
|
||||
s - service: 服务
|
||||
|
||||
### 2. 机器人负载
|
||||
|
||||
机器人的标称负载,单位为`Kg`,必须
|
||||
|
||||
5/7/10/16/20
|
||||
|
||||
### 3. 机器人系列扩展代码
|
||||
|
||||
一般为**单个大写字母**,为标准系列的改性(一般加长或者减短连杆,升级关节电机减速器等),可选
|
||||
|
||||
L: 连杆加长版本
|
||||
B: 负载增加(缩短连杆?)
|
||||
S: 高速(电机或减速器升级)
|
||||
RS:
|
||||
RX: 柔性?
|
||||
TD: 特高压带电?
|
||||
|
||||
### 4. 机器人版本升级或定制代码
|
||||
|
||||
一般出现在主型号(<机器人系列代码><机器人负载><机器人系列扩展代码>)之后,通过减号连接,字符和数字的组合,可选
|
||||
|
||||
i20-1650: 1650指代臂展(非常不建议)
|
||||
|
||||
|
||||
|
||||
## 内部用模型文件及.conf文件命名规范
|
||||
|
||||
```
|
||||
<品牌简称小写>_<机器人系列代码><机器人负载>_<机器人SN码中对应的版本>
|
||||
|
||||
aubo_i5_10 # i5标准版
|
||||
aubo_i5_11 # i5标准版末端360
|
||||
aubo_i5_12 # i5标准版加长版
|
||||
aubo_i5_13 # i5标准版加长版末端360
|
||||
```
|
||||
|
||||
### 1. 现行SN码简介
|
||||
|
||||
| 型号 | 型号说明 | 版本 | 版本说明 | 改动号 | 改动说明 |
|
||||
| :--: | :------: | :--: | :----------------------------------------------------: | :----: | :----------------------: |
|
||||
| 03 | i3 | 10 | 标准版:ID1-6 ±175° | A | 标准版 |
|
||||
| 05 | i5 | 11 | 标准版末端360:ID1-5 ±175° ID6 ±360° | B | 标准版末端360 |
|
||||
| 07 | i7 | 12 | 标准版加长版:ID1-6 ±175° | C | 标准版加长版 |
|
||||
| 10 | i10 | 13 | 标准版加长版末端360:ID1-5 ±175° ID6 ±360° | D | 标准版加长版末端360 |
|
||||
| 11 | i12(i10B) | 14 | 普通高速版本:ID1-6 ±175° | E | 高速瑞声版 |
|
||||
| 16 | i16 | 15 | 高速瑞声版:ID1-6 ±175° | F | 高速标准版 |
|
||||
| 20 | i20 | 16 | 普通高速末端360版本:ID1-5 ±175° ID6 ±360° | G | 高速标准版末端360 |
|
||||
| 13 | C3 | 17 | 高速标准版:ID1-6 ±175° | H | 高速小减速比版 |
|
||||
| 15 | C5 | 18 | 高速标准版末端360:ID1-5 ±175° ID6 ±360° | I | 高速小减速比版末端360 |
|
||||
| 17 | C10 | 19 | 高速小减速比版:ID1-6 ±175° | J | 标准版配六维力传感器 |
|
||||
| 18 | C16 | 20 | 高速小减速比版末端360:ID1-5 ±175° ID6 ±360° | K | 标准版配视觉 |
|
||||
| 19 | C20 | 21 | 标准版配六维力传感器:ID1-6 ±175° | L | 高速标准版配六维力传感器 |
|
||||
| 23 | E3 | 22 | 标准版配视觉:ID1-6 ±175° | M | 高速标准版配视觉 |
|
||||
| 24 | i30 | 23 | 高速标准版配六维力传感器:ID1-6 ±175° | N | 高速标准版加长版 |
|
||||
| 25 | E5 | 24 | 高速标准版配视觉:ID1-6 ±175° | O | 高速标准版加长版末端360 |
|
||||
| 21 | E10 | 25 | 高速标准版加长版:ID1-6 ±175° | P | 高速末端360/ID1 360 |
|
||||
| 26 | E16 | 26 | 高速标准版加长版末端360:ID1-5 ±175° ID6 ±360° | Q | 特殊定制版 |
|
||||
| 22 | E20 | 27 | 高速末端360/ID1 360:ID1 ±360° ID2-5 ±175° ID6 ±360° | R | 标准版(标配360) |
|
||||
| 33 | G3 | 28 | 标准版ID1 360:ID1 ±360° ID2-6±175° | S | 高速标准版(标配360) |
|
||||
| 34 | G6 | 29 | 特殊定制版:ID1-6 ±175° | T | 标准加长版(标配360) |
|
||||
| 35 | i3H | 30 | 标准版(标配360):ID1-6 ±360° | U | 配一维力控传感器 |
|
||||
| 36 | i5H | 31 | 高速标准版(标配360):ID1-6 ±360° | V | 关节限位 |
|
||||
| 37 | i7H | 32 | 标准加长版(标配360):ID1-6 ±360° | W | i5改i7 |
|
||||
| 38 | i10H | 33 | 高速标准加长版(标配360):ID1-6 ±360° | | |
|
||||
| 39 | i12H | 34 | 标准版配六维力传感器(标配360):ID1-6 ±360° | | |
|
||||
| 40 | i16H | 35 | 高速瑞声版(标配360):ID1-6 ±360° | | |
|
||||
| 41 | T12 | 36 | 柏惠维康版(标配360):ID1-6 ±360° | | |
|
||||
| 42 | T6 | 37 | 标准版配一维力传感器(外走线标配360):ID1-6 ±360° | | |
|
||||
| | | 38 | 标准版配一维力传感器(内走线标配360):ID1-6 ±360° | | |
|
||||
| | | 39 | 标准版(CANLite协议):ID1-6 ±360° | | |
|
||||
|
||||
|
||||
### 2. 已支持的机器人型号
|
||||
|
||||
| 机器人型号 | 是否量产 | 备注 |
|
||||
| :---------: | :------: | :--------------------------------------------: |
|
||||
| aubo_i3 | | 保留型号,兼容之前版本 |
|
||||
| aubo_i3_10 | × | 量产版本已变更,现为老版本 |
|
||||
| aubo_i3_30 | √ | 实际量产版本 |
|
||||
| aubo_i3_31 | √ | 如影定制 |
|
||||
| aubo_i3_37 | √ | 力控一维外走线 |
|
||||
| aubo_i3_38 | √ | 力控一维内走线 |
|
||||
| aubo_S3 | × | 低成本机械臂 |
|
||||
| aubo_i5 | | 保留型号,兼容之前版本 |
|
||||
| aubo_i5_10 | × | 量产版本已变更,现为老版本 |
|
||||
| aubo_i5_11 | × | 末端360。量产版本已变更,现为老版本 |
|
||||
| aubo_i5_30 | √ | 标准版本,目前发往海外主要量产版本。近期会变更 |
|
||||
| aubo_i5_31 | √ | 实际量产出货版本 |
|
||||
| aubo_i5_36 | √ | 柏惠维康版 |
|
||||
| aubo_i5_37 | √ | 力控一维外走线 |
|
||||
| aubo_i5_38 | √ | 力控一维内走线 |
|
||||
| aubo_i5L | | 留型号,兼容之前版本 |
|
||||
| aubo_i5_12 | × | 量产版本已变更,现为老版本 |
|
||||
| aubo_i5_13 | × | 末端360。量产版本已变更,现为老版本 |
|
||||
| aubo_i5_32 | √ | 实际量产版本 |
|
||||
| aubo_i5_33 | × | 高速标准加长版 |
|
||||
| aubo_i5F_34 | √ | 力控定制版 |
|
||||
| aubo_iS5 | x | 高性能机械臂 |
|
||||
| aubo_i7 | | 保留型号,兼容之前版本 |
|
||||
| aubo_i7_10 | × | 量产版本已变更,现为老版本 |
|
||||
| aubo_i7_11 | × | 末端360。量产版本已变更,现为老版本 |
|
||||
| aubo_i7_30 | √ | 实际量产版本 |
|
||||
| aubo_iS7 | x | 高性能机械臂 |
|
||||
| aubo_i10 | | 保留型号,兼容之前版本 |
|
||||
| aubo_i10_10 | × | 量产版本已变更,现为老版本 |
|
||||
| aubo_i10_11 | × | 末端360。量产版本已变更,现为老版本 |
|
||||
| aubo_i10_30 | √ | 实际量产版本 |
|
||||
| aubo_i12 | | 保留型号,兼容之前版本 |
|
||||
| aubo_i12_30 | √ | 实际量产版本 |
|
||||
| aubo_i16 | | 保留型号,兼容之前版本 |
|
||||
| aubo_i16_30 | √ | 实际量产版本 |
|
||||
| aubo_i20 | | 保留型号,兼容之前版本 |
|
||||
| aubo_i20_30 | √ | 实际量产版本,即原本i10B |
|
||||
| aubo_c3_30 | √ | 铂睿谐波 |
|
||||
| aubo_c5_30 | √ | 铂睿谐波+自研电机 |
|
||||
| aubo_e3_10 | √ | 铂睿谐波 |
|
||||
| aubo_e5_10 | √ | 铂睿谐波+自研电机 |
|
||||
| aubo_e10_10 | √ | 自研电机 |
|
||||
| aubo_i5h_30 | √ | 自研电机+三编码器 |
|
||||
|
||||
|
||||
|
||||
## 如何导入一个新的机器人型号
|
||||
|
||||
参考 [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
## 生成校准版 URDF
|
||||
|
||||
可以使用 `scripts/calibrate_urdf_dh.py` 读取机器人 RPC 返回的 DH 校准补偿,并生成新的校准版 URDF 文件。
|
||||
脚本启动时会先检查运行依赖;当前至少需要 `numpy` 和可导入的 `pyaubo_sdk`。
|
||||
|
||||
```bash
|
||||
python3 scripts/calibrate_urdf_dh.py \
|
||||
--robot-model aubo_i10H \
|
||||
--robot-ip 192.168.15.128 \
|
||||
--temperature 20
|
||||
```
|
||||
|
||||
也可以直接把 `--urdf-in` 写成机器人名称,脚本会自动到 `urdf/` 目录下查找对应文件:
|
||||
|
||||
```bash
|
||||
python3 scripts/calibrate_urdf_dh.py \
|
||||
--urdf-in aubo_i10H \
|
||||
--robot-ip 192.168.15.128 \
|
||||
--temperature 20
|
||||
```
|
||||
|
||||
默认输出路径为 `urdf/<robot_model>_calibrated.urdf`,会直接和其他 `.urdf` 文件放在一起。脚本不会覆盖输入 URDF;若目标文件已存在,需要显式传入 `--force`。
|
||||
|
||||
生成新的校准版 URDF 后,需要重新执行 `colcon build --packages-select aubo_description`,使新文件被正确安装到工作空间。
|
||||
|
||||
# 在 gazebo 中仿真 aubo 机器人(以 aubo_i5 为例)
|
||||
|
||||
roslaunch aubo_gazebo aubo_bringup.launch robot_model:=aubo_i5
|
||||
|
||||
roslaunch aubo_i5_moveit_config moveit_planning_execution.launch sim:=true
|
||||
|
||||
roslaunch aubo_i5_moveit_config moveit_rviz.launch
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user