# ROS_Tutorial **Repository Path**: jason__buaa/ros_-tutorial ## Basic Information - **Project Name**: ROS_Tutorial - **Description**: 学习古月居主讲的ROS入门时对应的例子和后续自学部分的记录 - **Primary Language**: C++ - **License**: LGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 1 - **Created**: 2020-09-10 - **Last Updated**: 2022-07-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ROS_Tutorial ## 介绍 1. 学习古月居主讲的ROS入门时对应的例子(learning_**系列文件夹)。 2. Gazebo学习过程记录。 ## 软件架构 [基于ROS系统的架构设计](https://github.com/S2-group/icse-seip-2020-replication-package/blob/master/ICSE_SEIP_2020.pdf) ## ROS-Gazebo学习资源 1. [使用Gazebo创建一个小车](https://gitee.com/jason__buaa/ros-tutorial-gazebo-simulation/wikis/Sec.-3:-Creating-a-custom-robot-and-sensor-model?sort_id=3090926) 2. [ROS_Gazebo_Tutorial](https://github.com/NRottmann/ROS_Gazebo_Tutorial) 3. [机器人操作系统入门](https://www.icourse163.org/course/ISCAS-1002580008) 4. [对应的文本教程](https://sychaichangkun.gitbooks.io/ros-tutorial-icourse163/content/) 5. [演示工程仓库](https://hub.fastgit.org/DroidAITech/ROS-Academy-for-Beginners/branches) ## 使用说明 1. 将仓库拷贝到本地并编译索引。为了避免每次都要重新索引,可以到/home/[用户名]/.bashrc文件中添加下面这一句,注意将“你的路径”修改好 source /home/你的路径/ros_-tutorial/catkin_ws/devel/setup.bash ```bash git clone https://gitee.com/jason__buaa/ros_-tutorial.git cd ros_-tutorial cd catkin_ws rosdep install --from-paths src --ignore-src --rosdistro=melodic -y catkin_make source devel/setup.bash ``` 注意:在Jetson Xavier中运行本例子时会发生编译错误,提示opencv路径错误,这是由于Jetson在最新的JetPack中opencv由v2升级到了v4.我们需要降到v3版本。 ```bash sudo apt install libopencv-dev=3.2.0+dfsg-4ubuntu0.1 ``` 2. 使用rqt_plot工具查看话题变量的实时变化。可以运行 ```bash roslaunch learning_launch start_tf_demo_c++.launch ``` 打开一个新的终端,输入 ```bash rosrun rqt_plot rqt_plot ``` 在打开的matplot界面中左侧topic列表中输入/turtle2/pose,单击右侧加号,就可以看到一系列信号被添加到示波器中去了。 3. 运行博物馆XBot仿真界面 ```bash rospack profile ``` ```bash roslaunch robot_sim_demo robot_spawn.launch ``` 再打开一个新的终端,输入以下命令,用键盘控制机器人移动 ```bash rosrun robot_sim_demo robot_keyboard_teleop.py ``` 聚焦控制程序窗口,按下i、j、l等按键,这样你就可以通过键盘来控制机器人的移动了。 ## 常用指令 * tree * rospack list * rospack list | grep catkin_ws * rospack find package_name * rosls Package_name * rosed package_name package_file_name * roscd package_name * ls ## ROS开发手册 1. [ROS developer's guide](http://wiki.ros.org/DevelopersGuide) 2. [ROS C++ Style Guide](http://wiki.ros.org/CppStyleGuide) 3. [PyStyleGuide](http://wiki.ros.org/PyStyleGuide) 4. [如何使用Markdown制作文档](https://docs.github.com/en/free-pro-team@latest/github/writing-on-github) 5. [C++ Primer中文版](https://cloud.189.cn/t/FvuEr2vEzeYn(访问码:85lt)) 6. [C++ Primer英文版](https://cloud.189.cn/t/uiuiMvMR7vie(访问码:m3pd)) 7. [Multiple 2D Object Tracker](https://github.com/r7vme/khmot) 8. [Wire Tracker Package](http://wiki.ros.org/wire) 9. [持续集成](https://zhuanlan.zhihu.com/p/59686072) 10. [SocketCAN上对虚拟CAN(vcan)的CAN FD支持](https://www.codenong.com/36568167/) ## 开发工具 1. terminator,自带终端的增强版 ```bash sudo apt install terminator ``` 2. [rosbag_to_csv, 用于将bag文件转换为.csv格式的GUI工具](https://github.com/AtsushiSakai/rosbag_to_csv) ```bash rosrun rosbag_to_csv rosbag_to_csv.py ``` 3. VS Code,其提供ROS插件。[参考](https://zhuanlan.zhihu.com/p/150331361) 4. [wireshark监控CAN总线](http://www.hackdig.com/07/hack-104746.htm) 5. [freecad,免费三维CAD软件](http://www.iearobotics.com/wiki/index.php?title=Dise%C3%B1o_de_piezas_con_Freecad) 6. [Waveshare CAN extension borad for raspberry pi](https://www.waveshare.net/wiki/2-CH_CAN_HAT) ## 安装Carla 1. 为APT安装程序设置代理。 ```bash sudo gedit /etc/apt/apt.conf ``` 增加如下一句话到文件中: Acquire::http::Proxy "http://127.0.0.1:8889"; 保存。如果不需要代理则删掉。 2. [使用源代码编译Carla](https://carla.readthedocs.io/en/latest/build_linux/) ## BUG记录 1. 安装完Anaconda之后,运行ROS程序会提示找不到rospkg.[解决方法](https://blog.csdn.net/Kingknot/article/details/104271964) 2. 安装完Anaconda之后,运行ROS时Python脚本找不到tf。[解决方法](https://www.cnblogs.com/hgl0417/p/11562580.html) 3. [ROS:No module named 'em' 解决方法](https://www.cnblogs.com/zmm1996/p/10775283.html) ## Nvidia Jetson Xavier配置 1. [CAN配置指导](https://steinslab.io/archives/1712) ## Raspberry Pi 4 Ubuntu 20 Desktop Configuration 1. [Enable SPI and I2C on Ubuntu 20.04 Raspberry Pi](https://askubuntu.com/questions/1273700/enable-spi-and-i2c-on-ubuntu-20-04-raspberry-pi) 2. Bugfix for installing CAN using Waveshare CAN extension board: ```bash sudo nano /boot/firmware/config.txt ``` ## Raspberry Pi 4 官方32bit系统 1. [Install Gazebo Dependencies From Sources](http://gazebosim.org/tutorials?tut=install_dependencies_from_source) 2. [Install Gazebo](http://gazebosim.org/tutorials?tut=install_from_source)