鱼香ROS社区
    • 版块
    • 最新
    • 未解决
    • 已解决
    • 群组
    • 注册
    • 登录
    紧急通知:禁止一切关于政治&VPN翻墙等话题,发现相关帖子会立马删除封号
    提问前必看的发帖注意事项: 社区问答规则(小鱼个人)更新 | 高质量帖子发布指南

    代码报错

    已定时 已固定 已锁定 已移动
    机器人学
    colcon build 包依赖
    1
    2
    151
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • 2
      2251752108
      最后由 编辑

      sunrise@ubuntu:~/Desktop/stm32_communication$ colcon build
      Starting >>> stm32_communication
      [Processing: stm32_communication]
      --- stderr: stm32_communication
      CMake Warning:
      Manually-specified variables were not used by the project:

      CATKIN_INSTALL_INTO_PREFIX_ROOT
      

      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp: In constructor ‘Stm32Communicator::Stm32Communicator()’:
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:36:27: error: ‘class drivers::serial_driver::SerialPort’ has no member named ‘init_port’
      36 | serial_port_->init_port(port, {baud_rate, fc, pt, sb});
      | ^~~~~~~~~
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:38:32: error: ‘class drivers::serial_driver::SerialPort’ has no member named ‘port_open’
      38 | if (!serial_port_->port_open()) {
      | ^~~~~~~~~
      In file included from /opt/ros/humble/include/rclcpp/rclcpp/logging.hpp:24,
      from /opt/ros/humble/include/rclcpp/rclcpp/client.hpp:40,
      from /opt/ros/humble/include/rclcpp/rclcpp/callback_group.hpp:24,
      from /opt/ros/humble/include/rclcpp/rclcpp/any_executable.hpp:20,
      from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategy.hpp:25,
      from /opt/ros/humble/include/rclcpp/rclcpp/memory_strategies.hpp:18,
      from /opt/ros/humble/include/rclcpp/rclcpp/executor_options.hpp:20,
      from /opt/ros/humble/include/rclcpp/rclcpp/executor.hpp:37,
      from /opt/ros/humble/include/rclcpp/rclcpp/executors/multi_threaded_executor.hpp:25,
      from /opt/ros/humble/include/rclcpp/rclcpp/executors.hpp:21,
      from /opt/ros/humble/include/rclcpp/rclcpp/rclcpp.hpp:155,
      from /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:3:
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:42:39: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘long int’ [-Wformat=]
      42 | RCLCPP_INFO(get_logger(), "Serial port %s opened at %d baud",
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      43 | port.c_str(), baud_rate);
      | ~~~~~~~~~
      | |
      | long int
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:42:66: note: format string is defined here
      42 | RCLCPP_INFO(get_logger(), "Serial port %s opened at %d baud",
      | ~^
      | |
      | int
      | %ld
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp: In lambda function:
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:67:58: error: ‘using element_type = class drivers::common::IoContext’ {aka ‘class drivers::common::IoContext’} has no member named ‘run’
      67 | io_thread_ = std::thread(this { io_context_->run(); });
      | ^~~
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp: In destructor ‘virtual Stm32Communicator::~Stm32Communicator()’:
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:72:22: error: ‘using element_type = class drivers::common::IoContext’ {aka ‘class drivers::common::IoContext’} has no member named ‘stop’
      72 | io_context_->stop();
      | ^~~~
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp: In member function ‘void Stm32Communicator::read_from_stm32()’:
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:119:28: error: ‘class drivers::serial_driver::SerialPort’ has no member named ‘port_open’
      119 | if (!serial_port_->port_open()) return;
      | ^~~~~~~~~
      In file included from /usr/include/c++/11/memory:76,
      from /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:1:
      /usr/include/c++/11/bits/unique_ptr.h: In instantiation of ‘typename std::_MakeUniq<_Tp>::__single_object std::make_unique(_Args&& ...) [with _Tp = drivers::serial_driver::SerialPort; _Args = {drivers::common::IoContext&}; typename std::_MakeUniq<_Tp>::__single_object = std::unique_ptrdrivers::serial_driver::SerialPort]’:
      /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:18:72: required from here
      /usr/include/c++/11/bits/unique_ptr.h:962:30: error: no matching function for call to ‘drivers::serial_driver::SerialPort::SerialPort(drivers::common::IoContext&)’
      962 | { return unique_ptr<_Tp>(new _Tp(std::forward<_Args>(__args)...)); }
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      In file included from /opt/ros/humble/include/serial_driver/serial_driver.hpp:22,
      from /home/sunrise/Desktop/stm32_communication/src/stm32_communicate.cpp:5:
      /opt/ros/humble/include/serial_driver/serial_port.hpp:173:3: note: candidate: ‘drivers::serial_driver::SerialPort::SerialPort(const drivers::common::IoContext&, const string&, drivers::serial_driver::SerialPortConfig)’
      173 | SerialPort(
      | ^~~~~~~~~~
      /opt/ros/humble/include/serial_driver/serial_port.hpp:173:3: note: candidate expects 3 arguments, 1 provided
      gmake[2]: *** [CMakeFiles/stm32_serial_node.dir/build.make:76:CMakeFiles/stm32_serial_node.dir/src/stm32_communicate.cpp.o] 错误 1
      gmake[1]: *** [CMakeFiles/Makefile2:137:CMakeFiles/stm32_serial_node.dir/all] 错误 2
      gmake: *** [Makefile:146:all] 错误 2

      Failed <<< stm32_communication [36.0s, exited with code 2]

      Summary: 0 packages finished [38.1s]
      1 package failed: stm32_communication
      1 package had stderr output: stm32_communication

      2 1 条回复 最后回复 回复 引用 0
      • 2
        2251752108 @2251752108
        最后由 编辑

        @小伊 请帮我解决一下

        1 条回复 最后回复 回复 引用 0
        • 第一个帖子
          最后一个帖子
        皖ICP备16016415号-7
        Powered by NodeBB | 鱼香ROS