uzh-rpg / rpg_quadrotor_control

Quadrotor control framework developed by the Robotics and Perception Group
Other
595 stars 190 forks source link

gazebo died when I try to get image_view #58

Closed YuTingLiu closed 4 years ago

YuTingLiu commented 6 years ago

<?xml version="1.0"?>
<!--
  Copyright 2015 Fadri Furrer, ASL, ETH Zurich, Switzerland
  Copyright 2015 Michael Burri, ASL, ETH Zurich, Switzerland
  Copyright 2015 Mina Kamel, ASL, ETH Zurich, Switzerland
  Copyright 2015 Janosch Nikolic, ASL, ETH Zurich, Switzerland
  Copyright 2015 Markus Achtelik, ASL, ETH Zurich, Switzerland

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<robot name="$(arg mav_name)" xmlns:xacro="http://ros.org/wiki/xacro">
  <!-- Instantiate the mav-->
  <xacro:include filename="$(find rotors_description)/urdf/mav_generic_odometry_sensor.gazebo" />

    <!--Mount a Camera-->

  <xacro:camera_macro
    namespace="${namespace}"
    parent_link="${namespace}/base_link"
    camera_suffix="nadir"
    frame_rate="20.0"
    horizontal_fov="2"
    image_width="752"
    image_height="480"
    image_format="L8"
    min_distance="0.02"
    max_distance="50"
    noise_mean="0.0"
    noise_stddev="0.007"
    enable_visual="true">

      <box size="0.05 0.05 0.02" />
      <origin xyz="0 0 0.1" rpy="0 1 0" />
   </xacro:camera_macro>

</robot>

I run my ros environment in docker. this is file I modified for cam simulation , I start this lanuch by "roslaunch rpg_rotors_interface quadrotor_empty_world_lyt.launch" . everything works fine, but when I want to see some images. command is "rosrun image_view image_view image:=/hummingbircamera_nadir/image_raw". the gazebo crushed.

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-1] process has died [pid 13966, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -u -e ode /root/catkin_ws/src/rotors_simulator/rotors_gazebo/worlds/empty.world __name:=gazebo __log:=/root/.ros/log/4bf7965c-429d-11e8-bc40-0242ac110003/gazebo-1.log].
log file: /root/.ros/log/4bf7965c-429d-11e8-bc40-0242ac110003/gazebo-1*.log

I tried to add "export SVGA_VGPU10=0 to .bashrc file. seem doesn't work. what should I do, have anyone has this problem? how to fix it, thx.

foehnx commented 6 years ago

Hi @YuTingLiu Does the launch file work when you run it without your modification (without adding the camera)? I would suggest to debug the way you add the camera since the problem might come from this modification. You might take a look at this page to get some info about adding sensors: http://gazebosim.org/tutorials?tut=ros_gzplugins

YuTingLiu commented 6 years ago

@foehnph It works fine without camera, only if I want to image_view the raw data...

foehnx commented 6 years ago

I would recommend to try the linked tutorial: http://gazebosim.org/tutorials?tut=ros_gzplugins

foehnx commented 6 years ago

could you ever solve the problem? can we close the issue?

shivamsardana commented 6 years ago

This error is occurring when we are using VMWare. @foehnph , have you encountered this problem? Is there any fix ?

foehnx commented 6 years ago

@shivamsardana well, we can not reproduce the problem since it works over here. did you also try to add a camera? is the standard configuration working?

javi555 commented 6 years ago

Same problem here, trying to integrate ros camera.

UD16.04 xenial, VMWare_12Player(accel_3d enabled), Gazebo7, ros-kinetic, export SVGA_VGPU10=0.

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-3] process has died 

[WORKED] In UD18.04 bionic & Gazebo9 & ros-melodic]

shivamsardana commented 5 years ago

@shivamsardana well, we can not reproduce the problem since it works over here. did you also try to add a camera? is the standard configuration working?

Yes, it's working. Gazebo 7 has issue on VMWare. i installed Gazebo 8 with ROS Kinetic. It is working.

rubenanapu commented 5 years ago

I've gone through the same problem.

The gazebo version that comes with ROS Kinetic is 7.0.0. I found at https://bitbucket.org/osrf/gazebo/issues/1837/vmware-rendering-z-ordering-appears-random that this problem is solved in gazebo 7.4.0.

If we just upgrade gazebo (as of today, 2019-06-07), the new version will be 7.15.0 and the problem will be gone.

To install 7.15.0, I just followed http://gazebosim.org/tutorials?cat=install&tut=install_ubuntu&ver=7.0 and I didn't have this problem anymore.

The commands I used in ROS Kinetic, Ubuntu 16.04 are:

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
SerifeC commented 5 years ago

rubenanapu yanıtı işe yaradı çok teşekkürler=> https://github.com/uzh-rpg/rpg_quadrotor_control/issues/58#issuecomment-499814392

aalonsopuig commented 4 years ago

The commands I used in ROS Kinetic, Ubuntu 16.04 are:

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

Thanks @rubenanapu, I had the same problem using virtual machine with VirtualBox. Your solution works.

MingCheng991129 commented 4 years ago

I've gone through the same problem.

The gazebo version that comes with ROS Kinetic is 7.0.0. I found at https://bitbucket.org/osrf/gazebo/issues/1837/vmware-rendering-z-ordering-appears-random that this problem is solved in gazebo 7.4.0.

If we just upgrade gazebo (as of today, 2019-06-07), the new version will be 7.15.0 and the problem will be gone.

To install 7.15.0, I just followed http://gazebosim.org/tutorials?cat=install&tut=install_ubuntu&ver=7.0 and I didn't have this problem anymore.

The commands I used in ROS Kinetic, Ubuntu 16.04 are:

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

Very useful!! It does work, thx!!!

YuTingLiu commented 4 years ago

Thanks, closed

princebansal commented 4 years ago

I've gone through the same problem.

The gazebo version that comes with ROS Kinetic is 7.0.0. I found at https://bitbucket.org/osrf/gazebo/issues/1837/vmware-rendering-z-ordering-appears-random that this problem is solved in gazebo 7.4.0.

If we just upgrade gazebo (as of today, 2019-06-07), the new version will be 7.15.0 and the problem will be gone.

To install 7.15.0, I just followed http://gazebosim.org/tutorials?cat=install&tut=install_ubuntu&ver=7.0 and I didn't have this problem anymore.

The commands I used in ROS Kinetic, Ubuntu 16.04 are:

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

You deserve a ROSCAR 🏆

rwortham commented 4 years ago

Super helpful. Fixed my Gazebo camera problem :) - Ubuntu 16.04 ROS Kinetic in VirtualBox 6