Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prepare spawn launch for Gazebo #59

Open
rayvburn opened this issue Feb 20, 2023 · 1 comment · May be fixed by #60
Open

prepare spawn launch for Gazebo #59

rayvburn opened this issue Feb 20, 2023 · 1 comment · May be fixed by #60
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rayvburn
Copy link
Owner

To avoid a need of copying whole world files only to place actors in other locations

@rayvburn rayvburn added enhancement New feature or request help wanted Extra attention is needed labels Feb 20, 2023
@rayvburn
Copy link
Owner Author

rayvburn commented Sep 25, 2023

First attempt to tackle this issue was performed.

First of all:

cd $(rospack find hubero_gazebo)
mkdir models
touch models/actor.sdf

And paste the following into the new .sdf file:

<?xml version="1.0"?>
<sdf version="1.6">

<actor name="actor3">
    <pose>6.30 2.50 1.00 1.5707 0 -1.5707</pose>
    <skin>
        <filename>walk.dae</filename>
        <scale>1.0</scale>
    </skin>
    <!-- laser sensor -->
    <link name="laser_link">
        <sensor type="gpu_ray" name="laser">
        <!-- CS info: x - side axis, y - height, z - person's nose heading -->
        <pose>0 -0.8 0.55 0 -1.57 -1.57</pose>
        <visualize>false</visualize>
        <update_rate>10</update_rate>
        <ray>
        <scan>
            <horizontal>
            <samples>720</samples>
            <resolution>1</resolution>
            <min_angle>-2.170796</min_angle>
            <max_angle>2.170796</max_angle>
            </horizontal>
        </scan>
        <range>
            <min>0.10</min>
            <max>10.0</max>
            <resolution>0.01</resolution>
        </range>
        <noise>
            <type>gaussian</type>
            <!-- Noise parameters based on published spec for Hokuyo laser
                achieving "+-30mm" accuracy at range < 10m.  A mean of 0.0m and
                stddev of 0.01m will put 99.7% of samples within 0.03m of the true
                reading. -->
            <mean>0.0</mean>
            <stddev>0.01</stddev>
        </noise>
        </ray>
        <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so">
        <topicName>/hubero/actor3/receptor/laser_scan</topicName>
        <frameName>actor3/base_laser_link</frameName>
        </plugin>
    </sensor>
    </link>

    <animation name="walk">
        <filename>walk.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>
    <animation name="stand">
        <filename>stand.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>
    <animation name="sit_down">
        <filename>sit_down.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>
    <animation name="sitting">
        <filename>sitting.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>
    <animation name="stand_up">
        <filename>stand_up.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>
    <animation name="run">
        <filename>run.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>
    <animation name="talk_a">
        <filename>talk_a.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>
    <animation name="talk_b">
        <filename>talk_b.dae</filename>
        <scale>1.000000</scale>
        <interpolate_x>true</interpolate_x>
    </animation>

    <plugin name="actor3_plugin" filename="libhubero_gazebo_actor.so">
    </plugin>
</actor>
</sdf>

Before launching the Gazebo simulation, update plugin paths with:

export GAZEBO_PLUGIN_PATH=<PATH TO WS>/devel/.private/hubero_gazebo/lib:$GAZEBO_PLUGIN_PATH

And while the simulation is already running, call:

rosrun gazebo_ros spawn_model -sdf -file $(rospack find hubero_gazebo)/models/actor.sdf -model actortest

The actor should appear in the simulation in the standing pose (it it runs forward repeatedly, there is something wrong).

The main problems now are:

  • parameterizing the .sdf (pose, name),
  • preparing the launch file that not only spawns the actor plugin instance, but also loads all necessary navigation parameters,
  • for some reason, the spawn_model waits for timeout instead of closing then the model loads.
    SpawnModel script started
    [INFO] [1695654000.437389, 0.000000]: Loading model XML from file
    [INFO] [1695654000.439737, 0.000000]: Waiting for service /gazebo/spawn_sdf_model
    [INFO] [1695654000.444363, 0.000000]: Calling service /gazebo/spawn_sdf_model
    [INFO] [1695654052.424471, 24.448000]: Spawn status: SpawnModel: Entity pushed to spawn queue, but spawn service timed out waiting for entity to appear in simulation under the name actorrrr

rayvburn added a commit that referenced this issue Sep 25, 2023
…spawn_actor.launch` for spawning Actors without modifying the existing world files [#59]
@rayvburn rayvburn linked a pull request Sep 25, 2023 that will close this issue
rayvburn added a commit that referenced this issue Sep 25, 2023
…spawn_actor.launch` for spawning Actors without modifying the existing world files [#59]
rayvburn added a commit that referenced this issue Oct 2, 2023
…spawn_actor.launch` for spawning Actors without modifying the existing world files [#59]
rayvburn added a commit that referenced this issue Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant