Ubuntu20.04 + noetic + TurtleBot3仿真

安装turtlebot3依赖包

sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc ros-noetic-rgbd-launch ros-noetic-depthimage-to-laserscan ros-noetic-rosserial-arduino ros-noetic-rosserial-python ros-noetic-rosserial-server ros-noetic-rosserial-client ros-noetic-rosserial-msgs ros-noetic-amcl ros-noetic-map-server ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro  ros-noetic-compressed-image-transport ros-noetic-rqt-image-view ros-noetic-gmapping ros-noetic-navigation  ros-noetic-interactive-markers

安装turtlebot3源码

$ cd ~/catkin_ws/src/
$ git clone https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
$ git clone -b melodic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
$ cd ~/catkin_ws && catkin_make

添加模型声明

echo "export TURTLEBOT3_MODEL=waffle" >> ~/.bashrc

环境设置

echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc

安装turtlebot3_simulation包

cd ~/catkin_ws/src/
git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git 
cd ~/catkin_ws && catkin_make

新终端,启动仿真测试

$ export TURTLEBOT3_MODEL=waffle
## TURTLEBOT3_MODEL有burger, waffle或waffle_pi三种
$ roslaunch turtlebot3_fake turtlebot3_fake.launch

安装过程中出现的问题

  • catkin_package() DEPENDS on the catkin package'message_runtime' which must therefore be listed as a run dependency in the package.xml
    原因:该错误出现是因为仅添加了包依赖,而未添加包运行依赖,解决方法,加上错误一解决的第二、三条语句在package.xml中
    解决办法:在package.xml中添加
<build_export_depend>message_generation</build_export_depend>
<exec_depend>message_runtime</exec_depend>

-Could not find a package configuration file provided by "gazebo_ros" with any of the following names:
原因:没有安装或者更新gazebo-ros-control功能包
解决办法:在终端运行sudo apt-get install ros-noetic-gazebo-ros-pkgs ros-noetic-gazebo-ros-control即可

  • ERROR: cannot launch node of type [robot_state_publisher/robot_state_publisher]: robot_state_publisher

  • 原因:这是robot_state_publisher包缺失导致的问题
    解决办法:sudo apt-get install ros-noetic-robot-state-publisher
    安装以后更新一下软件包索引sudo apt-get update

  • ERROR: cannot launch node of type [rviz/rviz]: rviz ROS path [0]=/opt/ros/noetic/share/ros ROS path [1]=/home/wjy/catkin_ws/src ROS path [2]=/opt/ros/noetic/share
    -原因:这是rrviz包缺失导致的问题
    解决办法:sudo apt-get install ros-noetic-rviz
    安装以后更新一下软件包索引sudo apt-get update

你可能感兴趣的:(ROS)