mmwise / sphero_ros

A Sphero ROS driver.
76 stars 61 forks source link

Spawning model in Gazebo - black dot #10

Open tredbobek opened 8 years ago

tredbobek commented 8 years ago

Hi!

I'm trying to spawn a sphero ball in gazebo. I have installed this sphero_ros (indigo ROS). If I start an empty_world in gazebo, then spawn the model with it's URDF,

rosrun gazebo_ros spawn_model -file `rospack find sphero_description`/urdf/sphero.urdf -urdf -z 1 -model Sphero

(_rospack find spherodescription has an apostrophe at the start and at the end)

and the only thing that appears is a really really small black ball.

Same happens using this (part of a launch file):

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" default="worlds/empty.world"/>
    <arg name="paused" value="$(arg paused)"/>
  </include>

  <include file="$(find sphero_bringup)/launch/sphero.launch">
  </include>

  <node name="spawn_gazebo_model" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot -z 0.1" respawn="false" output="screen" />

Any idea how can I spawn this sphero in Gazebo? My goal is to spawn a Sphero ball in Gazebo and then make it run around in a circle. (Gazebo is working, I can spawn an UR5 robot, although that has a xarco file that generates an URDF)

Is it even possible to spawn a model from sphero.urdf? (or even the whole "move the ball around" thing. Already had problems with bluetooth. I don't need bluetooth for gazebo)

Oh, and one another funny thing:

Error [Material.cc:93] Unable to find texture[file:///SpheroTexture.jpg] in path[/home/user/catkin_ws/src/sphero_ros/sphero_description/meshes]

Can't understand why it can't find that .jpg, it's right where it says, with all the other .dae files.

Thank you.

tredbobek commented 8 years ago

Okay, I managed to get a Sphero ball into Gazebo. The things I changed:

In sphero.urdf:

    <visual>
      <origin xyz=" 0 0 0" rpy="3.14 0 0" />
      <geometry>
    <mesh filename="package://sphero_description/meshes/Sphero_Textured.dae" scale=" 0.0127 0.0127 0.0127"/>
      </geometry>
    </visual>

changed the scale to 0.8 0.8 0.8. The original scale seems to be too small.

In Sphero_Textured.dae:

  <library_images>
    <image id="file1-image" name="file1">
      <init_from>file:///SpheroTexture.jpg</init_from>
    </image>
  </library_images>

Deleted the "file:///" part. It was searching for a file named "file:///SpheroTexture.jpg" in the correct location.

I might have to change the scale, because it's probably not the correct size.

All it's left is to make it move...