Можно ли автоматически управлять моделью света traffi c в симуляторе Gazebo? - PullRequest
0 голосов
/ 17 марта 2020

У меня есть готовая модель светофора c на беседке, и я хочу, чтобы он отражал 5 секунд каждый красный и зеленый свет.

Я все еще не мог понять это. Если мы установим эмиссионное значение в строке комментария, оно перестает отражаться.

Как я могу превратить этот код в fla sh 5 секунд красного и зеленого?

<?xml version="1.0" ?>

<static>true</static>

<!-- this pose can be overriden when including the light on another model -->
<pose>0 0 1.0 0 0 0</pose>

<link name="link">

  <collision name="collision">
    <geometry>
      <mesh>
        <uri>model://stop_light/meshes/stop_light.obj</uri>
        <scale>0.01 0.01 0.01</scale>
      </mesh>
    </geometry>
  </collision>

  <visual name="frame">
    <geometry>
      <mesh>
        <uri>model://stop_light/meshes/stop_light.obj</uri>
        <scale>0.01 0.01 0.01</scale>
      </mesh>
    </geometry>
  </visual>

  <visual name="red">
    <pose>-0.001123 -0.082251 -0.147514 0 0 0</pose>
    <geometry>
      <sphere>
        <radius>0.1012</radius>
      </sphere>
    </geometry>
    <material>
      <script>
        <uri>model://stop_light/materials/scripts/</uri>
        <uri>model://stop_light/materials/textures/</uri>
        <name>StopLight/Light</name>
      </script>
      <ambient>1 0 0 1</ambient>
      <specular>1 0 0 1</specular>
      <!-- Turn a light on by uncommenting emissive -->
      <!--emissive>1 0 0 1</emissive-->
    </material>
  </visual>

  <visual name="yellow">
    <pose>-0.001123 -0.082251 -0.402 0 0 0</pose>
    <geometry>
      <sphere>
        <radius>0.1012</radius>
      </sphere>
    </geometry>
    <material>
      <script>
        <uri>model://stop_light/materials/scripts/</uri>
        <uri>model://stop_light/materials/textures/</uri>
        <name>StopLight/Light</name>
      </script>
      <ambient>1 1 0 1</ambient>
      <specular>1 1 0 1</specular>
      <!--emissive>1 1 0 1</emissive-->
    </material>
  </visual>

  <visual name="green">
    <pose>-0.001123 -0.082251 -0.655 0 0 0</pose>
    <geometry>
      <sphere>
        <radius>0.1012</radius>
      </sphere>
    </geometry>
    <material>
      <script>
        <uri>model://stop_light/materials/scripts/</uri>
        <uri>model://stop_light/materials/textures/</uri>
        <name>StopLight/Light</name>
      </script>
      <ambient>0 1 0 1</ambient>
      <specular>0 1 0 1</specular>
      <!--emissive>0 1 0 1</emissive-->
    </material>
  </visual>

</link>

enter image description here

...