ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

Looking at the IRSensor source code, I think you need to have one "ir" XML child node per actual IR sensor on the IR ring. The only example of a config file that I could find is here.

Looking at the IRSensor source code, I think you need to have one "ir" XML child node per actual IR sensor on the IR ring. The only example of a config file that I could find is here., but that seems to be really outdated.

Looking at the IRSensor source code, I think you need to have one "ir" <ir> XML child node per actual IR sensor on the IR ring. The only example of a config file that I could find is here, but that seems to be really outdated.

Edit: If you look at the source code, you can see that the parameter irCount is not read. Instead, I guess it returns the number of <ir> children.

Looking at the IRSensor source code, I think you need to have one <ir> XML child node per actual IR sensor on the IR ring. The only example of a config file that I could find is here, but that seems to be really outdated.

Edit: If you look at the source code, you can see that the parameter irCount is not read. Instead, I guess it returns should return the number of <ir> children.children, although I cannot see where this is done in the source code.

Looking at the IRSensor source code, I think you need to have one <ir> XML child node per actual IR sensor on the IR ring. The only example of a config file that I could find is here, but that seems to be really outdated.

Edit: If you look at the source code, you can see that the parameter irCount is not read. Instead, I guess it should return the number of <ir> children, although I cannot see where this is done in the source code.

Edit 2: I think the XML should look something like this, but I haven't tested it yet:

<xacro:property name="ir_min_range" value="0.1" />
<xacro:property name="ir_max_range" value="0.8" />
<xacro:property name="ir_res_range" value="0.03" />
<xacro:property name="ir_fov" value="0.074859848" />

<gazebo reference="base_link">
  <sensor:ir name="ir_ring">
    <irCount>1</irCount>
    <ir name="ir_back">
      <rayCount>5</rayCount>
      <rangeCount>5</rangeCount>
      <minAngle>${M_PI - ir_fov/2}</minAngle>
      <maxAngle>${M_PI + ir_fov/2}</maxAngle>
      <minRange>${ir_min_range}</minRange>
      <maxRange>${ir_max_range}</maxRange>
      <resRange>${ir_res_range}</resRange>
      <origin>-0.217 0 0</origin>
      <displayRays>true</displayRays>
    </ir>
    <updateRate>100.0</updateRate>
  </sensor:ir>
</gazebo>

Looking at the IRSensor source code, I think you need to have one <ir> XML child node per actual IR sensor on the IR ring. The only example of a config file that I could find is here, but that seems to be really outdated.

Edit: If you look at the source code, you can see that the parameter irCount is not read. Instead, I guess it should return the number of <ir> children, although I cannot see where this is done in the source code.

Edit 2: I think the XML should look something like this, but I haven't tested it yet:

<xacro:property name="ir_min_range" value="0.1" />
<xacro:property name="ir_max_range" value="0.8" />
<xacro:property name="ir_res_range" value="0.03" />
<xacro:property name="ir_fov" value="0.074859848" />

<gazebo reference="base_link">
  <sensor:ir name="ir_ring">
    <irCount>1</irCount>
    <ir name="ir_back">
      <rayCount>5</rayCount>
      <rangeCount>5</rangeCount>
      <minAngle>${M_PI - ir_fov/2}</minAngle>
      <maxAngle>${M_PI + ir_fov/2}</maxAngle>
      <minRange>${ir_min_range}</minRange>
      <maxRange>${ir_max_range}</maxRange>
      <resRange>${ir_res_range}</resRange>
      <origin>-0.217 0 0</origin>
      <displayRays>true</displayRays>
    </ir>
    <updateRate>100.0</updateRate>
  </sensor:ir>
</gazebo>