gazebo::sensors::Sensor::SetActive not working for ray sensor

Create issue
Issue #2625 new
Former user created an issue

My code is following,

void MyRaySensorPlugin::Load(gazebo::sensors::SensorPtr _sensor,
                                           sdf::ElementPtr _sdf) {
  _sensor->SetActive(false);
  std::cout << "sensor activeness : " << _sensor->IsActive() << " to ";
  _sensor->SetActive(true);
  std::cout << _sensor->IsActive() << std::endl;
}

My sdf file is following.

<sensor name="my_laserscan" type="ray">
        <always_on>false</always_on>
        <visualize>false</visualize>
        <pose>0 0 0 0 0 0</pose>
        <update_rate>5</update_rate>
        <ray>
          <scan>
            <horizontal>
              <samples>360</samples>
              <resolution>1.000000</resolution>
              <min_angle>0.000000</min_angle>
              <max_angle>6.280000</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.120000</min>
            <max>3.5</max>
            <resolution>0.015000</resolution>
          </range>
          <noise>
            <type>gaussian</type>
            <mean>0.0</mean>
            <stddev>0.01</stddev>
          </noise>
        </ray>
        <plugin name="my_laserscan_plugin" filename="libmy_laserscan_plugin.so">
          <ros>
            <namespace>gazebo</namespace>
          </ros>
        </plugin> 
        <plugin name="gazebo_laserscan" filename="libgazebo_ros_ray_sensor.so">
          <ros>
            <argument>~/out:=scan</argument>
          </ros>
          <output_type>sensor_msgs/LaserScan</output_type>
          <frame_name>base_scan</frame_name>
        </plugin>
      </sensor>

The output is always sensor activeness : 1 to 1, although the expected output is sensor activeness : 0 to 1.

Comments (1)

  1. Log in to comment