Error While Adding two Logical Cameras to a robot

asked 2021-02-17 13:48:59 -0500

// Go through each link's sensors until a logical camera is found

96 for (physics::LinkPtr link : this->model->GetLinks()) 97 { 98 for (unsigned int i = 0; i < link->GetSensorCount(); ++i) 99 { 100 sensors::SensorPtr sensor = sensorManager->GetSensor(link->GetSensorName(i)); 101 if (sensor->Type() == "logical_camera") 102 { 103 this->sensor = sensor; 104 break; 105 } 106 } 107 if (this->sensor) 108 { 109 this->cameraLink = link; 110 break;


I am trying to add two logical cameras to a robot. One on the sideand one facing the front. The above piece of code has created an issue. Due to which both the front and the side logical cameras show the same output wherein only the objects placed on the front of the camera are seen. Am I right, is the issue due to the above function in the logicalcamera plugin file? Is there a possible fix for this issue. Has anyone corrected it. Can anyone suggest a possible fix.

link


xacro file <robot name="basic_car"> <material name="blue"> <color rgba="0 0 1 1"/> </material>

<link name="base_link">
    <visual>
      <geometry>           

        <mesh filename="package://car_description/meshes/car_019.dae"/> 
      </geometry>

    <origin rpy="0 0 -1.5708" xyz="-0.05 0 0.56"/>
     <material name="blue"/>
    </visual>    
    <collision>
      <geometry>
      <box size="1.4 3.8 0.3"/>
      </geometry>
    <origin rpy="0 0 -1.5708" xyz="0 0 0.45"/>
    </collision>

    <inertial>
          <mass value="1"/>
          <inertia ixx="1" ixy="0.0" ixz="0.0" iyy="1" iyz="0.0" izz="1"/>
          <origin rpy="0 0 -1.5708" xyz="-0.05 0 0.56"/>
</inertial>
</link>    

<link name="left_wheel">
    <collision>
      <geometry>
     <cylinder length="0.1" radius="0.3"/>
      </geometry>
    <surface>
        <friction>
          <ode>
            <mu>100000</mu>
            <mu2>100000</mu2>
          </ode>
        </friction>
    </surface>
      <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
    </collision>
    <visual>
      <geometry>
     <cylinder length="0.1" radius="0.3"/>
      </geometry>
      <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
    </visual>
        <inertial>
  <mass value="1"/>
  <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>
  <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
</inertial>
</link>

<link name="right_wheel">

    <collision>
      <geometry>
     <cylinder length="0.1" radius="0.3"/>
      </geometry>
      <surface>
        <friction>
          <ode>
            <mu>100000</mu>
            <mu2>100000</mu2>
          </ode>
        </friction>
    </surface>
    <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
    </collision>
    <visual>
      <geometry>
     <cylinder length="0.1" radius="0.3"/>
      </geometry>
    <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
    </visual>
<inertial>
  <mass value="1"/>
  <inertia ixx="0.01" ixy="0.0" ixz="0.0" iyy="0.01" iyz="0.0" izz="0.01"/>
  <origin rpy="0 1.5707 1.5707" xyz="0 0 0"/>
</inertial>

</link>

<link name="rear_left_wheel">

    <collision>
      <geometry>
     <cylinder length="0.1" radius ...
(more)
edit retag flag offensive close merge delete