1.在上一篇ros功能包helloros中编辑一个cpp,命名hello.cpp,代码完全是c++,如下:


#include<iostream>
using namespace std;

int main()

{
     cout<<"hello"<<endl;

     cin.get();
     return 0;

}

2.回到根目录下catkin_make,编译无误,打开roscore,然后

rosrun helloros hello

ROS基础--用c++风格代码也可以运行

3.代码竟然运行起来了,记录一下。

 

相关文章:

  • 2022-12-23
  • 2021-09-20
  • 2022-01-07
  • 2021-06-11
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
猜你喜欢
  • 2022-12-23
  • 2021-12-25
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-25
相关资源
相似解决方案