0
$\begingroup$

Rosanswers logo

I recently upgraded to ROS Fuerte on Ubuntu 12.04 and am unable to load my old Gazebo camera files. I have an empty world spawned and running and then attempt to spawn my camera model in a launch file:

<launch>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>

<!-- set use_sim_time flag -->
<group if="$(arg use_sim_time)">
    <param name="/use_sim_time" value="true" />
</group>

<!-- start empty world -->
<node name="empty_world_server" pkg="gazebo" type="gazebo" args="$(find gazebo_worlds)/worlds/empty_throttled.world" respawn="false" output="screen" />

<!-- start gui -->
<group if="$(arg gui)">
    <node name="gazebo_gui" pkg="gazebo" type="gui" respawn="false" output="screen"/>
</group>

<node name="spawn_east_camera" pkg="gazebo" type="spawn_model" args="-file $(find rrl_simulation)/robots/test.urdf -urdf -x -2.5 -z 2.0 -P 0.87 -model east_camera" respawn="false" output="screen" />

The following is the URDF of the camera:

<?xml version="1.0"?>

<gazebo reference="east_camera">
    <sensor:camera name="east_camera_sensor">
        <imageSize>640 480</imageSize>
        <imageFormat>R8G8B8</imageFormat>
        <hfov>90</hfov>
        <nearClip>0.01</nearClip>
        <farClip>100</farClip>
        <updateRate>30.0</updateRate>
        <controller:gazebo_ros_camera name="east_camera_controller" plugin="libgazebo_ros_camera.so">
            <alwaysOn>true</alwaysOn>
            <updateRate>10.0</updateRate>
            <imageTopicName>sim_east_camera/image_raw</imageTopicName>
            <interface:camera name="east_camera_interface" />
        </controller:gazebo_ros_camera>
    </sensor:camera>
    <turnGravityOff>true</turnGravityOff>
    <material>Gazebo/Blue</material>
</gazebo>

Once I try and spawn in, the following errors are produced:

... logging to /home/rctoris/.ros/log/d7e20176-95f5-11e1-9b89-782bcbad8931/roslaunch-MAGLEV-26292.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://MAGLEV:51648/

SUMMARY
========

PARAMETERS
 * /rosdistro
 * /rosversion
 * /use_sim_time

NODES
  /
    empty_world_server (gazebo/gazebo)
    gazebo_gui (gazebo/gui)
    spawn_east_camera (gazebo/spawn_model)

auto-starting new master
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[master]: started with pid [26308]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to d7e20176-95f5-11e1-9b89-782bcbad8931
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[rosout-1]: started with pid [26321]
started core service [/rosout]
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[empty_world_server-2]: started with pid [26335]
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[gazebo_gui-3]: started with pid [26343]
Gazebo multi-robot simulator, version 1.0.1
Copyright (C) 2011 Nate Koenig, John Hsu, Andrew Howard, and contributors.
Released under the Apache 2 License.
http://gazebosim.org

Dbg pluginPaths and GAZEBO_PLUGIN_PATH doesn't exist.Set GAZEBO_PLUGIN_PATH to Ogre's installation path. ...or are you loading via SystemPlugins?
Gazebo multi-robot simulator, version 1.0.1
Copyright (C) 2011 Nate Koenig, John Hsu, Andrew Howard, and contributors.
Released under the Apache 2 License.
http://gazebosim.org

Dbg pluginPaths and GAZEBO_PLUGIN_PATH doesn't exist.Set GAZEBO_PLUGIN_PATH to Ogre's installation path. ...or are you loading via SystemPlugins?
Exception AttributeError: AttributeError("'_DummyThread' object has no attribute '_Thread__block'",) in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
process[spawn_east_camera-4]: started with pid [26352]
Msg Waiting for master.[ INFO] [1336141892.480896480]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Msg Waiting for master
Msg Connected to gazebo master @ http://localhost:11345
loading model xml from file
waiting for service spawn_urdf_model

Msg Connected to gazebo master @ http://localhost:11345
Warning [parser.cc:330] Gazebo SDF has no gazebo element
Warning [parser.cc:269] parse as sdf version 1.0 failed, trying to parse as old deprecated format
Warning [parser.cc:275] parse as old deprecated world file failed, trying old model format.
Dbg Node[physical] Has empty key value[static]
Dbg Node[empty] Has empty key value[]
Dbg Node[camera] Has empty key value[alwaysOn]
Dbg skipping prefixed element [interface:camera] when copying plugins
spawn status:  SpawnModel: successfully spawned model
Dbg Unable to find element with name[depth_camera] return empty
Error [CameraPlugin.cc:39] CameraPlugin requires a CameraSensor.
Msg It is a depth camera sensor
Segmentation fault (core dumped)
[empty_world_server-2] process has died [pid 26335, exit code 139, cmd /opt/ros/fuerte/stacks/simulator_gazebo/gazebo/scripts/gazebo /opt/ros/fuerte/stacks/simulator_gazebo/gazebo_worlds/worlds/empty_throttled.world __name:=empty_world_server __log:=/home/rctoris/.ros/log/d7e20176-95f5-11e1-9b89-782bcbad8931/empty_world_server-2.log].
log file: /home/rctoris/.ros/log/d7e20176-95f5-11e1-9b89-782bcbad8931/empty_world_server-2*.log
[spawn_east_camera-4] process has finished cleanly
log file: /home/rctoris/.ros/log/d7e20176-95f5-11e1-9b89-782bcbad8931/spawn_east_camera-4*.log
[gazebo_gui-3] process has finished cleanly
log file: /home/rctoris/.ros/log/d7e20176-95f5-11e1-9b89-782bcbad8931/gazebo_gui-3*.log
^C[rosout-1] killing on exit
[master] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done

The above used to work in Electric. Is there some change I missed that I should use to convert my camera sensor to be able to work in Fuerte?


Originally posted by rtoris288 on ROS Answers with karma: 1173 on 2012-05-04

Post score: 7


Original comments

Comment by MorganCormier on 2012-05-05:
I also have the same error ("Exception AttributeError: AttributeError") on several of my packages. Hope this thread will solve our problem

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

After looking around for a little while I was able to recreate a gazebo_ros_camera. Here is the new .model file as an example for anyone looking to create a camera to stream ROS images in the future:

<gazebo version='1.0'>
  <model name="overhead_camera">
    <link name="link">
      <origin pose="0 0 0 0 0 0"/>

      <inertial mass="0.1">
        <inertia ixx="1" ixy="0" ixz="0" iyy="1" iyz="0" izz="1"/>
      </inertial>

      <visual name="visual">
        <origin pose="0 0 0 0 0 0"/>
        <geometry>
          <box size="0.1 0.1 0.1"/>
        </geometry>
      </visual>

      <sensor name='camera' type='camera' always_on='1' update_rate='30' visualize='true'>
        <camera>
          <horizontal_fov angle='1.57079633'/>
          <image width='640' height='480' format='R8G8B8'/>
          <clip near='0.1' far='100'/>
        </camera>
        <plugin name="camera_plugin" filename="libgazebo_ros_camera.so">
            <alwaysOn>true</alwaysOn>
            <imageTopicName>image_raw</imageTopicName>
            <cameraInfoTopicName>camera_info</cameraInfoTopicName>
            <updateRate>30.0</updateRate>
            <cameraName>overhead_camera</cameraName>
            <frameName>overhead_camera_frame</frameName>
            <CxPrime>320.5</CxPrime>
            <Cx>320.5</Cx>
            <Cy>240.5</Cy>
            <hackBaseline>0</hackBaseline>
            <focalLength>320.000101</focalLength>
            <distortionK1>0.0</distortionK1>
            <distortionK2>0.0</distortionK2>
            <distortionK3>0.0</distortionK3>
            <distortionT1>0.0</distortionT1>
            <distortionT2>0.0</distortionT2>
        </plugin>
      </sensor>
    </link>
  </model>
</gazebo>

Originally posted by rtoris288 with karma: 1173 on 2012-05-09

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.