fix: fix grpc_cpp_plugin rpath

This commit is contained in:
lgv 2026-01-27 11:38:07 +08:00
parent 4085835277
commit 6c6ba72967
368 changed files with 49 additions and 393 deletions

View File

@ -36,7 +36,7 @@ find_package(protobuf REQUIRED)
find_package(gRPC REQUIRED)
############################################################
# PROTO
# PROTO , proto build cmake --install . --verbose
############################################################
set(PROTO_IMPORT_DIR ${PROJECT_SOURCE_DIR}/protos)
@ -44,6 +44,12 @@ set(PROTO_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/_protobuf)
file(MAKE_DIRECTORY ${PROTO_BINARY_DIR})
file(GLOB_RECURSE PROTO_FILES ${PROTO_IMPORT_DIR}/*.proto)
set(Protobuf_PROTOC_EXECUTABLE "${CMAKE_INSTALL_PREFIX}/bin/protoc" CACHE FILEPATH "" FORCE)
set_property(TARGET gRPC::grpc_cpp_plugin
PROPERTY IMPORTED_LOCATION "${CMAKE_INSTALL_PREFIX}/bin/grpc_cpp_plugin"
)
# 1) OBJECT/ pb.cc
add_library(proto-objects OBJECT)
target_sources(proto-objects PRIVATE ${PROTO_FILES})
@ -70,7 +76,8 @@ add_library(proto SHARED $<TARGET_OBJECTS:proto-objects>)
target_include_directories(proto PUBLIC ${PROTO_BINARY_DIR} ${PROTO_IMPORT_DIR} ${Protobuf_INCLUDE_DIRS})
target_link_libraries(proto PUBLIC protobuf::libprotobuf gRPC::grpc++ gRPC::grpc++_reflection)
add_library(cmvr_es::proto ALIAS proto)
install(TARGETS proto RUNTIME DESTINATION bin)
#install(TARGETS proto RUNTIME DESTINATION bin)
install(TARGETS proto LIBRARY DESTINATION lib)
############################################################
# include
############################################################

View File

@ -15,6 +15,7 @@ function(setup_external_libs ARCH)
# For install
set(INSTALL_SO_FILES)
set(INSTALL_BIN_FILES) # proto protoc grpc_cpp_plugin
foreach(REL_PATH ${LINES})
# Skip comments / empty lines
@ -86,6 +87,20 @@ function(setup_external_libs ARCH)
endif()
endif()
# ---- bin (protoc / grpc_cpp_plugin) ----
if(EXISTS "${FULL_PATH}/bin")
#
if(EXISTS "${FULL_PATH}/bin/grpc_cpp_plugin")
list(APPEND INSTALL_BIN_FILES "${FULL_PATH}/bin/grpc_cpp_plugin")
endif()
if(EXISTS "${FULL_PATH}/bin/protoc")
list(APPEND INSTALL_BIN_FILES "${FULL_PATH}/bin/protoc")
endif()
if(EXISTS "${FULL_PATH}/bin/protoc-31.1.0")
list(APPEND INSTALL_BIN_FILES "${FULL_PATH}/bin/protoc-31.1.0")
endif()
endif()
if(HAS_INCLUDE OR HAS_LIB)
math(EXPR LIB_COUNT "${LIB_COUNT} + 1")
endif()
@ -136,6 +151,31 @@ function(setup_external_libs ARCH)
]])
endif()
# ---- install third-party tools into <prefix>/bin ----
if(INSTALL_BIN_FILES)
list(REMOVE_DUPLICATES INSTALL_BIN_FILES)
install(PROGRAMS ${INSTALL_BIN_FILES} DESTINATION bin)
# After installing, patch RPATH of installed tools to $ORIGIN/../lib
install(CODE [[
execute_process(COMMAND bash -lc
"set -e
if ! command -v patchelf >/dev/null 2>&1; then
echo '[install] patchelf not found, skip patch bin rpath'
exit 0
fi
echo '[install] patch rpath under: ${CMAKE_INSTALL_PREFIX}/bin'
for f in '${CMAKE_INSTALL_PREFIX}/bin/protoc' '${CMAKE_INSTALL_PREFIX}/bin/grpc_cpp_plugin'; do
if [ -f \"$f\" ]; then
patchelf --set-rpath '$ORIGIN/../lib' \"$f\"
fi
done
echo '[install] done (bin rpath)'"
)
]])
endif()
if(LIB_COUNT GREATER 0)
message(STATUS "Successfully setup ${LIB_COUNT} external libraries for ${ARCH}")
else()

Binary file not shown.

View File

@ -1,152 +0,0 @@
<CMVR-ES>
<Constants rootDir="/home/xtkuang/projects/cmvr-es"/>
<Logger dir="../log" level="info" bufSize="5" logSize="1024"/>
<DeviceManager name="cmvr_es" ver="0.1" description="cmvr edge system version 0.1">
<Devices>
<AGV>
</AGV>
<Battery>
</Battery>
<Camera>
<!-- <UVCCamera id="cam1" serial="/dev/video6" w="640" h="480" fps="30" mode="video" codec="H265"/>-->
<!-- <UVCCamera id="cam2" serial="/dev/video14" w="640" h="480" fps="30" mode="video" codec="H265"/>-->
<!-- <RealsenseCamera id="cam3" serial="243122072252" w="640" h="480" fps="30" mode="video" stream_mode="rgbd" align_mode="color" codec="H265"/>-->
<!-- <RealsenseCamera id="cam4" serial="243122075614" w="1280" h="720" fps="30" mode="video" stream_mode="rgbd" align_mode="color" codec="H265"/>-->
<!-- <MechMind id="cam5" ip="10.148.108.111" align="true" _2dtype="color"/>-->
<!-- <RealsenseCamera id="cam6" serial="243122075389" w="640" h="480" fps="30" mode="video" stream_mode="rgbd" align_mode="color" codec="H265"/>-->
</Camera>
<DexHand>
<!-- <RH56DFTP id="hand1" default_force="500" default_speed="500" ip_address="192.168.1.224" port="6000">-->
<!-- <Freedom order="01" default_force="500" default_speed="500" />-->
<!-- </RH56DFTP>-->
<!-- <RH56DFTP id="hand2" default_force="500" default_speed="500" ip_address="192.168.1.224" port="6000">-->
<!-- <Freedom order="01" default_force="500" default_speed="500" />-->
<!-- </RH56DFTP>-->
</DexHand>
<Robot>
<!-- <LeftArm id="left_arm" devtype="ti5Robot" />-->
<!-- <RightArm />-->
<!-- <Neck/>-->
<!-- <Humanoid id="hc01" dof="14"-->
<!-- urdf="/home/lgv/cmvr/cmvr-es/config/robot_description/hc_description/dual_arm.urdf"-->
<!-- baseLink="PELVIS_S"-->
<!-- jointNames="L_SHOULDER_P,L_SHOULDER_R,L_SHOULDER_Y,L_ELBOW_R,L_WRIST_P,L_WRIST_Y,L_WRIST_R,R_SHOULDER_P,R_SHOULDER_R,R_SHOULDER_Y,R_ELBOW_R,R_WRIST_P,R_WRIST_Y,R_WRIST_R"-->
<!-- linkNames="PELVIS_S,L_SHOULDER_P_S,L_SHOULDER_R_S,L_SHOULDER_Y_S,L_ELBOW_R_S,L_WRIST_P_S,L_WRIST_Y_S,L_WRIST_R_S,R_SHOULDER_P_S,R_SHOULDER_R_S,R_SHOULDER_Y_S,R_ELBOW_R_S,R_WRIST_P_S,R_WRIST_Y_S,R_WRIST_R_S,R_FINGER_TIP,R_CAM"-->
<!-- bufferSize="50"-->
<!-- verbose="false">-->
<!-- <CanManger id="" devId="">-->
<!-- <LeftArmCan id = " " devId = " " channelId ="0" enable="false" toolFrame="L_FINGER_TIP">-->
<!-- <Motor id="23" jointName="L_SHOULDER_P" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="24" jointName="L_SHOULDER_R" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="25" jointName="L_SHOULDER_Y" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="26" jointName="L_ELBOW_R" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="27" jointName="L_WRIST_P" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="21" jointName="L_WRIST_Y" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="22" jointName="L_WRIST_R" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- </LeftArmCan>-->
<!-- <RightArmCan id = " " devId = " " channelId ="1" enable="true" toolFrame="R_FINGER_TIP">-->
<!-- <Motor id="16" jointName="R_SHOULDER_P" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="17" jointName="R_SHOULDER_R" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="18" jointName="R_SHOULDER_Y" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="19" jointName="R_ELBOW_R" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="20" jointName="R_WRIST_P" limitQLb="-3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="28" jointName="R_WRIST_Y" limitQLb="-1.102" limitQUb="1.02" limitQd="3.0"/>-->
<!-- <Motor id="29" jointName="R_WRIST_R" limitQLb="-0.293" limitQUb="1.57079" limitQd="3.0"/>-->
<!-- </RightArmCan>-->
<!-- <HeadCan id = " " devId = " " channelId ="2" enable="true">-->
<!-- <Motor id="32" jointName="HEAD_Y" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="30" jointName="HEAD_P" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="31" jointName="HEAD_R" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- </HeadCan>-->
<!-- <WaistCan id = " " devId = " " channelId ="3" enable="false">-->
<!-- <Motor id="4" jointName="WAIST_Y" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- <Motor id="15" jointName="WAIST_P" limitQLb="3.14" limitQUb="3.14" limitQd="3.0"/>-->
<!-- </WaistCan>-->
<!-- </CanManger>-->
<!-- </Humanoid>-->
</Robot>
<BioHead>
<!-- <esp32 id="bio_head" serial="/dev/ttyUSB0" ctrlFreq="50">-->
<!-- &lt;!&ndash; 眉毛 &ndash;&gt;-->
<!-- <EyeBrow serial="64:0~3"-->
<!-- offest="90 90 90 90"-->
<!-- jLmtUp="90 170 155 110"-->
<!-- jLmtLow="20 77 90 20"/>-->
<!-- &lt;!&ndash; 眼睛 &ndash;&gt;-->
<!-- <Eye serial="64:4~9"-->
<!-- offest="90 90 90 90 90 90"-->
<!-- jLmtUp="90 150 165 90 120 115"-->
<!-- jLmtLow="20 90 90 25 70 75"/>-->
<!-- &lt;!&ndash; 嘴巴 &ndash;&gt;-->
<!-- <Mouth serial="65:0~9"-->
<!-- offest="90 90 90 90 90 90 90 90 90 90"-->
<!-- jLmtUp="150 110 130 140 100 105 110 125 90 95"-->
<!-- jLmtLow="70 30 80 80 65 55 45 80 85 90"/>-->
<!-- </esp32>-->
</BioHead >
<Microphone>
<!-- <ffmpegMicPhone id="mic1" alsa="hw:0" channels="2" sampleRate="44100" volume="80"/>-->
<!-- <ffmpegMicPhone id="mic2" alsa="hw:1" channels="1" sampleRate="44100" volume="80"/>-->
</Microphone>
<Speaker>
<ffmpegSpeaker id="spk1" serial="" alas="default" channels="2" sampleRate="44100" softResample="1" latency="50000" volume="100"/>
</Speaker>
<Canbus>
<!-- <rightArmCan id="can1" brand="SOCKET_CAN_RAW" type="USB_CARD" channel_id="CHANNEL_ID_ZERO" interface="NATIVE" baudrate="BCAN_BAUDRATE_500K"/>-->
</Canbus>
</Devices>
<HighLevelController>
<BioHeadExpre headId="bio_head" />
<CartesianWBC urdf="" />
<ScreenTouch robotID="" DexhandID="" />
</HighLevelController>
</DeviceManager>
<MonitorManager>
<DiskMonitor id="file_monitor" freq="1">
<!-- <Folder fileDir="/home/share/assets/audio" maxVolume="1000"/>-->
<!-- <Folder fileDir="/home/share/assets/image" maxVolume="1000"/>-->
<!-- <Folder fileDir="/home/share/assets/video" maxVolume="1000"/>-->
<!-- <Folder fileDir="../log" maxVolume="1000"/>-->
</DiskMonitor>
<JointMonitor id="robot_joint_monitor" freq="200">
<RobotJoint robotID="left_arm" motorID="0" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="left_arm" motorID="1" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="left_arm" motorID="2" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="left_arm" motorID="3" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="left_arm" motorID="4" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="left_arm" motorID="6" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="left_arm" motorID="7" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="right_arm" motorID="0" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="right_arm" motorID="1" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="right_arm" motorID="2" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="right_arm" motorID="3" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="right_arm" motorID="4" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="right_arm" motorID="6" maxTemp="80" maxCurrent="5" maxVel="2"/>
<RobotJoint robotID="right_arm" motorID="7" maxTemp="80" maxCurrent="5" maxVel="2"/>
</JointMonitor>
</MonitorManager>
<gRPCServer port="50052">
</gRPCServer>
</CMVR-ES>

View File

@ -1,25 +0,0 @@
realsense_cameras {
id: "cam2"
serialNumber: "123456789012"
width: 1280
height: 720
fps: 30
codec: "H265"
camera_mode: CAMERA_MODE_VIDEO
stream_mode: STREAM_MODE_RGBD
align_mode: ALIGN_MODE_COLOR
buffer_size: 30
sync: true
}
uvc_cameras {
id: "cam1"
usb: "/dev/video0"
width: 640
height: 480
fps: 30
codec: "H265"
camera_mode: CAMERA_MODE_PHOTO
stream_mode: STREAM_MODE_RGB
buffer_size: 30
}

View File

@ -1,9 +0,0 @@
urdf_path: "/home/lgv/cmvr/dual_arm.urdf"
base_frame_name: "PELVIS_S"
flange_frame_name: "R_FLANGE"
tcp_frame_name: "R_TCP"
max_iters: 100
pos_eps: 1e-6
rot_eps: 1e-6
damping: 1e-6

View File

@ -1,10 +0,0 @@
urdf_path: "/home/cmvr/Projects/cmvr-es/model/xiaoyan_description/dual_arm.urdf"
base_frame_name: "PELVIS_S"
flange_frame_name: "R_WRIST_R_S"
tcp_frame_name: "R_FINGER_TIP_FIXED"
lambda: 0.0001
w_posrot: 0.5
max_iters: 80
tol: 1e-6
qp_time_limit: 0.005

Binary file not shown.

View File

@ -1 +0,0 @@
libOsqpEigen.so.0.10.1

Binary file not shown.

View File

@ -1 +0,0 @@
libabsl_base.so.2505.0.0

Binary file not shown.

View File

@ -1 +0,0 @@
libabsl_city.so.2505.0.0

Binary file not shown.

View File

@ -1 +0,0 @@
libabsl_civil_time.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_cord.so.2505.0.0

Binary file not shown.

View File

@ -1 +0,0 @@
libabsl_cord_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_cordz_functions.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_cordz_handle.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_cordz_info.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_cordz_sample_token.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_crc32c.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_crc_cord_state.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_crc_cpu_detect.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_crc_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_debugging_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_decode_rust_punycode.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_demangle_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_demangle_rust.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_die_if_null.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_examine_stack.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_exponential_biased.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_failure_signal_handler.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_commandlineflag.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_commandlineflag_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_config.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_marshalling.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_parse.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_private_handle_accessor.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_program_name.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_reflection.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_usage.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_flags_usage_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_graphcycles_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_hash.so.2505.0.0

Binary file not shown.

View File

@ -1 +0,0 @@
libabsl_hashtablez_sampler.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_int128.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_kernel_timeout_internal.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_leak_check.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_log_flags.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_log_globals.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_log_initialize.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_log_internal_check_op.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_log_internal_conditions.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_log_internal_fnmatch.so.2505.0.0

View File

@ -1 +0,0 @@
libabsl_log_internal_format.so.2505.0.0

Some files were not shown because too many files have changed in this diff Show More