紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
自动化编译microROS的github仓库
-
做了自动化编译microROS的github仓库,有需要的可以自取。
目前是STM32F407VET6的静态库,适用于ROS2 iron版本。可在Release当中下载。
更换芯片之类的教程,待我之后来更新!
传送门:https://github.com/ganyuanzhen/microROSF407BinrayBuilder
-
@ganyuanzhen 使用的CMake文件如下,可自行取用
#此文件从模板自动生成! 请勿更改! set(CMAKE_SYSTEM_NAME Generic) set(CMAKE_SYSTEM_VERSION 1) cmake_minimum_required(VERSION 3.27) # specify cross-compilers and tools set(CMAKE_C_COMPILER arm-none-eabi-gcc) set(CMAKE_CXX_COMPILER arm-none-eabi-g++) set(CMAKE_ASM_COMPILER arm-none-eabi-gcc) set(CMAKE_AR arm-none-eabi-ar) set(CMAKE_OBJCOPY arm-none-eabi-objcopy) set(CMAKE_OBJDUMP arm-none-eabi-objdump) set(SIZE arm-none-eabi-size) set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) # project settings project(microROSF407 C CXX ASM) set(CMAKE_CXX_STANDARD 17) set(CMAKE_C_STANDARD 11) #Uncomment for hardware floating point add_compile_definitions(ARM_MATH_CM4;ARM_MATH_MATRIX_CHECK;ARM_MATH_ROUNDING) add_compile_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16) add_link_options(-mfloat-abi=hard -mfpu=fpv4-sp-d16) #Uncomment for software floating point #add_compile_options(-mfloat-abi=soft) add_compile_options(-mcpu=cortex-m4 -mthumb -mthumb-interwork) add_compile_options(-ffunction-sections -fdata-sections -fno-common -fmessage-length=0) # uncomment to mitigate c++17 absolute addresses warnings #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-register") # Enable assembler files preprocessing add_compile_options($<$<COMPILE_LANGUAGE:ASM>:-x$<SEMICOLON>assembler-with-cpp>) if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release") message(STATUS "Maximum optimization for speed") add_compile_options(-Ofast) elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo") message(STATUS "Maximum optimization for speed, debug info included") add_compile_options(-Ofast -g) elseif ("${CMAKE_BUILD_TYPE}" STREQUAL "MinSizeRel") message(STATUS "Maximum optimization for size") add_compile_options(-Os) else () message(STATUS "Minimal optimization, debug info included") add_compile_options(-Og -g) endif () ############################### #Import microROS Library Start# ############################### add_library( libmicroros STATIC IMPORTED ) set_target_properties( libmicroros PROPERTIES IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/microros_static_library/libmicroros/libmicroros.a ) list(APPEND microROS_Source "${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/extra_sources/custom_memory_manager.c") list(APPEND microROS_Source "${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/extra_sources/microros_time.c") list(APPEND microROS_Source "${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/extra_sources/microros_allocators.c") # Set here the custom transport implementation list(APPEND microROS_Source "${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/extra_sources/microros_transports/dma_transport.c") # list(APPEND microROS_Source "${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/extra_sources/microros_transports/it_transport.c") # list(APPEND microROS_Source "${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/extra_sources/microros_transports/udp_transport.c") # list(APPEND microROS_Source "${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/extra_sources/microros_transports/usb_cdc_transport.c") include_directories(${PROJECT_SOURCE_DIR}/micro_ros_stm32cubemx_utils/microros_static_library/libmicroros/microros_include) ############################# #Import microROS Library End# ############################# include_directories(Core/Inc Drivers/STM32F4xx_HAL_Driver/Inc Drivers/STM32F4xx_HAL_Driver/Inc/Legacy Middlewares/Third_Party/FreeRTOS/Source/include Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2 Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F Drivers/CMSIS/Device/ST/STM32F4xx/Include Drivers/CMSIS/Include) add_definitions(-DDEBUG -DUSE_HAL_DRIVER -DSTM32F407xx) file(GLOB_RECURSE SOURCES "Core/*.*" "Middlewares/*.*" "Drivers/*.*") set(LINKER_SCRIPT ${CMAKE_SOURCE_DIR}/STM32F407VETX_FLASH.ld) add_link_options(-Wl,-gc-sections,--print-memory-usage,-Map=${PROJECT_BINARY_DIR}/${PROJECT_NAME}.map) add_link_options(-mcpu=cortex-m4 -mthumb -mthumb-interwork) add_link_options(-T ${LINKER_SCRIPT}) add_executable(${PROJECT_NAME}.elf ${SOURCES} ${microROS_Source} ${LINKER_SCRIPT}) target_link_libraries(${PROJECT_NAME}.elf PUBLIC libmicroros) set(HEX_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.hex) set(BIN_FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}.bin) add_custom_command(TARGET ${PROJECT_NAME}.elf POST_BUILD COMMAND ${CMAKE_OBJCOPY} -Oihex $<TARGET_FILE:${PROJECT_NAME}.elf> ${HEX_FILE} COMMAND ${CMAKE_OBJCOPY} -Obinary $<TARGET_FILE:${PROJECT_NAME}.elf> ${BIN_FILE} COMMENT "Building ${HEX_FILE} Building ${BIN_FILE}")
-
此回复已被删除! -
@ganyuanzhen 大佬有没有foxy的版本啊 有么有上板子跑过
-
@472795832 还没上板子测试,这几天考试没去实验室。
过几天可帮你测试一下
-
@ganyuanzhen 欢迎出个教程,我给你发篇推广
-
@ganyuanzhen 跪求教程 我帮你验证
-