[ros-users] Creating new world file

John Hsu johnhsu at willowgarage.com
Thu May 6 02:34:28 UTC 2010


Hi Pratyush,
Please post the console error outputs and attach track.jpg.  But I suspect
you need to convert track.jpg to grayscale (single channel).
John

On Wed, May 5, 2010 at 6:28 PM, pratyush jalan <pratyush.jalan at gmail.com>wrote:

> Hi John
>
> So I was using Heightmap because one of one of friend had once created his
> world file (similar to the empty_world file) and this is what he had -:
> <model:physical name="terrain_model">
>  <xyz>0.0 0.0 -10</xyz>
>     <body:heightmap name ="terrain_body">
>       <geom:heightmap name="terrain_geom">
>  <image>track.jpg</image>
>         <worldTexture>track.jpg</worldTexture>
> <size>13 13 0.05</size>
>       </geom:heightmap>
>     </body:heightmap>
>   </model:physical>
> This was giving me the problem of " Image is not grayscale ". I changed
> that to one as used in the empty_world file
>  <model:physical name="willow_map">
>    <xyz>0 0 0</xyz>
>    <rpy>180 0 0</rpy>
>    <static>true</static>
>    <body:map name="willow_map_body">
>      <geom:map name="willow_map_geom">
>        <image>*track.jpg*</image>
>        <threshold>1</threshold>
>        <granularity>1</granularity>
>        <negative>false</negative>
>        <scale>0.01</scale>
>        <offset>0 0 0</offset>
>        <material>Gazebo/Rocky</material>
>      </geom:map>
>    </body:map>
>   </model:physical>
>
> But when I launch this, its gives me an error Coordinate out of range. It
> keeps displaying this error. ( in the first code, I changed the heightmap to
> just map and I am getting same as this error) I am sorry but I couldn't find
> any documentation for the world file.
>
> Thanks.
>
> Pratyush Jalan
>
>
>
> On Tue, May 4, 2010 at 11:21 PM, John Hsu <johnhsu at willowgarage.com>wrote:
>
>>
>> On Tue, May 4, 2010 at 7:50 PM, pratyush jalan <pratyush.jalan at gmail.com>wrote:
>>
>>> Hi John
>>>
>>> Thanks for the quick reply.
>>>
>>> 1) Yes, I am using heightmap. What should I use to use color image for
>>> the world ?
>>>
>>
>> I am not sure what you are trying to do here.  HeightMap takes a single
>> channel image and use that information to create a contoured trimesh floor
>> based on the value of the image intensity.  Are you trying to texture the
>> world with a color image?  If that's the case, heightmap will not do the
>> right thing here.
>>
>>
>>>
>>> 2) No I did not hit Ctrl+C. For running the pr2 robot, I first run the
>>> roslaunch gazebo_worlds empty_world.launch  then on another terminal
>>> roslaunch pr2_gazebo pr2.launch
>>> then on another terminal I run my C++ controller code( which basically
>>> sends velocity commands by publishing to the specific topic).
>>> This works great.
>>>
>>> But for the simplecar.model when I launch...it gives the specific message
>>> I sent in the earlier email and then by itself it return to the command
>>> prompt ( this does not happen when running pr2). heres the following content
>>> of my simplecar.launch
>>>
>>> <launch>
>>> <param name="simplecar" textfile="$(find
>>> gazebo_worlds)/objects/simplecar.model" />
>>>
>>>   <!-- push urdf to factory and spawn robot in gazebo -->
>>>   <node name="spawn_simplecar" pkg="gazebo_tools" type="gazebo_model"
>>> args="-p simplecar -x -5.5 -y -3.5 -z 1  -R 0 -P 0 -Y 0 spawn simplecar"
>>> respawn="false" output="screen" />
>>> </launch>
>>>
>>
>> Judging from above launch script, it's likely you have not spawned a
>> controller?  Please take a look at the example in
>> pr2_examples_gazebo/single_link.launch.  This example starts up a single
>> actuated joint using SimpleTransmission and JointPositionController.  You
>> might want to use JointEffortController or JointVelocityController for your
>> particular use case.
>>
>> John
>>
>>
>>> Thanks.
>>>
>>> Pratyush
>>>
>>>
>>> On Tue, May 4, 2010 at 10:23 PM, John Hsu <johnhsu at willowgarage.com>wrote:
>>>
>>>> Hi Pratyush,
>>>>
>>>> On Tue, May 4, 2010 at 7:04 PM, pratyush jalan <
>>>> pratyush.jalan at gmail.com> wrote:
>>>>
>>>>> Hi Everyone,
>>>>>
>>>>> 1) I am trying to create my own world file for Gazebo but when I launch
>>>>> my world it gives an error that the "Image is not grayscale". I created a
>>>>> simple image in paint with a white background and a path with black color. I
>>>>> tried using different colors as well but I get the same error each time. Can
>>>>> you suggest what might be the problem ?
>>>>>
>>>>
>>>> Please clarify the context... are you trying to use a heightmap?  If so,
>>>> the image needs to be saved as a grayscale image (single channel).  Note
>>>> that this is not the same as using a color image (multiple channels) with
>>>> black and white colors.
>>>>
>>>>
>>>>>
>>>>> 2) I am trying to run my controller code on the simplecar.model but the
>>>>> problem is the car does not move.
>>>>>
>>>>
>>>> are you using the pr2 mechanism controller stack?  If possible, please
>>>> post relevant world/model/launch files, to help with the debugging process.
>>>>
>>>>
>>>>> My code works for the pr2 robot (pr2_simulator). I am able to spawn the
>>>>> object in the Gazebo simulator. I get the following message when I spawn the
>>>>> object -:
>>>>> core service [/rosout] found
>>>>> process[spawn_simplecar-1]: started with pid [3814]
>>>>> [ INFO] 37.267000000: waiting for gazebo factory, usually launched by
>>>>> 'roslaunch `rospack find gazebo`/launch/empty_world.launch'
>>>>> [spawn_simplecar-1] process has finished cleanly.
>>>>>
>>>> log file:
>>>>> /home/stk/.ros/log/8f48d09e-57c6-11df-91b7-0024e82035d7/spawn_simplecar-1*.log
>>>>>
>>>>
>>>> looks fine so far...  Did you hit ctrl-c here?
>>>>
>>>>
>>>> thanks,
>>>> John
>>>>
>>>>
>>>>> all processes on machine have died, roslaunch will exit
>>>>> shutting down processing monitor...
>>>>> ... shutting down processing monitor complete
>>>>>
>>>> done
>>>>> Is this an error code ? I wasn't sure because the object is still
>>>>> getting spawned in the simulator.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> Pratyush
>>>>>
>>>>> _______________________________________________
>>>>> ros-users mailing list
>>>>> ros-users at code.ros.org
>>>>> https://code.ros.org/mailman/listinfo/ros-users
>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> ros-users mailing list
>>>> ros-users at code.ros.org
>>>> https://code.ros.org/mailman/listinfo/ros-users
>>>>
>>>>
>>>
>>> _______________________________________________
>>> ros-users mailing list
>>> ros-users at code.ros.org
>>> https://code.ros.org/mailman/listinfo/ros-users
>>>
>>>
>>
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
>>
>>
>
> _______________________________________________
> ros-users mailing list
> ros-users at code.ros.org
> https://code.ros.org/mailman/listinfo/ros-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-users/attachments/20100505/a696aec3/attachment-0003.html>


More information about the ros-users mailing list