rayvburn / hubero

HuBeRo - a Framework to Simulate Human Behaviour in Robot Research
https://github.com/rayvburn/hubero
BSD 3-Clause "New" or "Revised" License
3 stars 0 forks source link

prepare `spawn` launch for Gazebo #59

Open rayvburn opened 1 year ago

rayvburn commented 1 year ago

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

rayvburn commented 1 year ago

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: