蓝桥ROS机器人之ROS程序和普通程序以及APP/API等

2022-05-01 10:28:12 浏览数 (1)

有个问题记录一下:

  • ROS程序和普通程序有什么区别?
  • 什么是ROS应用?什么是ROS接口?

第一个问题,本质上没有区别的。

使用上有一些区别罢了。

第二个问题,pub或sub都支持很多模式,自己写个聊天工具都不难的。

命令行接口查看

图形化接口查看 

当然直接写个sub也行的。

这里直接在云课中使用古月居21讲内容。

推荐学生阅读(2019年左右一篇文章):

互联网下半场:从超级入口到超级接口,从超级APP到超级API

代码语言:javascript复制
shiyanlou:~/ $ history                                               [16:03:39]
    1  git clone https://github.com/rapiz1/DungeonRush.git
    2  apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev
    3  sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev
    4  w
    5  sudo apt update
    6  sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-net-dev libsdl2-ttf-dev
    7  ls
    8  cd DungeonRush
    9  ls
   10  cmake -B build && cmake --build build
   11  mkdir build
   12  cmake -B build && cmake --build build
   13  cd build
   14  cmake ..
   15  make 
   16  cd bin
   17  ls
   18  ./dungeon_rush
   19  cd ..
   20  make
   21  cd bin
   22  ./dungeon_rush
   23  cd ..
   24  make
   25  cd bin
   26  ./dungeon_rush
   27  git clone https://gitcode.net/ZhangRelay/ros_book.git
   28  unzip ros_21_tutorials-master.zip
   29  cd ros_ws
   30  catkin_make
   31  cal
   32  w
   33  source devel/setup.zsh
   34  rosrun learning_topic person_publisher
   35  roscore
   36  rostopic list
   37  rosnode list
   38  rostopic
   39  rostopic info /person_info
   40  source devel/setup.bash
   41  source devel/setup.zsh
   42  rosrun learning_topic person_subscriber
   43  rostopic info /person_info
   44  ./person_publisher
   45  rosrun learning_topic person_publisher
   46  ./person_subscriber
   47  rosrun learning_topic person_publisher
   48  ./person_subscriber
   49  ./person_publisher
   50  rostopic echo /person_info
   51  rqt
   52  ./person_subscriber
   53  rostopic list
   54  rostopic pub /person_info learning_topic/Person "name: 'csgl'nage: 62nsex: 0"
   55  rqt
shiyanlou:~/ $                                                       [16:03:44]

0 人点赞