使用 Gazebo 模擬 Camera,在讀取 Camera 影像時會報錯:
gzserver: /build/ogre-1.9-mqY1wq/ogre-1.9-1.9.0+dfsg1/OgreMain/src/OgreRenderSystem.cpp:546: virtual void Ogre::RenderSystem::setDepthBufferFor(Ogre::RenderTarget*): Assertion `bAttached && "A new DepthBuffer for a RenderTarget was created, but after creation" "it says it's incompatible with that RT"' failed.
Aborted (core dumped)
[gazebo-2] process has died [pid 13762, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /home/ros/catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/worlds/turtlebot3_world.world __name:=gazebo __log:=/home/ros/.ros/log/f9912bf6-854e-11eb-a61c-08002750e906/gazebo-2.log].
log file: /home/ros/.ros/log/f9912bf6-854e-11eb-a61c-08002750e906/gazebo-2*.log
根據網路上得到的訊息,是因為使用的 Gazebo 版本比較舊的關係。安裝 Gazebo 7.15.0 以後的版本就不會有這個問題了。
Ubuntu 16.04 + ROS Kinetic 預設使用的版本為 Gazebo 7.0.0:
$ gazebo -v Gazebo multi-robot simulator, version 7.0.0 Copyright (C) 2012-2016 Open Source Robotics Foundation. Released under the Apache 2 License. |
更新 Gazebo 版本:
$ sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list'
$ wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install gazebo7 -y |
更新為 Gazebo 7.16.1:
$ gazebo -v Gazebo multi-robot simulator, version 7.16.1 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. |
參考資料
- Gazebo died when I try to get image_view
https://github.com/uzh-rpg/rpg_quadrotor_control/issues/58
- Install Gazebo using Ubuntu packages
http://gazebosim.org/tutorials?tut=install_ubuntu
- Setting up ROS Kinetic and Gazebo 8 or 9
https://medium.com/@abhiksingla10/setting-up-ros-kinetic-and-gazebo-8-or-9-70f2231af21a
沒有留言:
張貼留言