URDF prismatic joint on 2 axis

asked 2015-11-13 05:26:06 -0500

dottant gravatar image

Hi all.
I have an URDF robot model in GAZEBO with a camera and i wanna move the camera on two axis Y,Z.
I know that i have to use the prismatic type, but i cant figure out how to set it. I've tried to create two joints between the base_link and the camera_link one for the Z slide and the other one for the Y slide but it gives me errors

[ERROR] [1447412621.880447632, 1337.300000000]: Tried to advertise a service that is already advertised in this node [/tablet_camera/set_parameters]
[ERROR] [1447412621.989409540, 1337.300000000]: Tried to advertise a service that is already advertised in this node [/tablet_camera/image_raw/compressedDepth/set_parameters]
[ERROR] [1447412622.090016972, 1337.300000000]: Tried to advertise a service that is already advertised in this node [/tablet_camera/image_raw/compressed/set_parameters]
[ERROR] [1447412622.263917910, 1337.300000000]: Tried to advertise a service that is already advertised in this node [/tablet_camera/image_raw/theora/set_parameters]
[ERROR] [1447412627.912015293, 1337.300000000]: This robot has a joint named "camera_joint_y" which is not in the gazebo model.
[FATAL] [1447412627.912106858, 1337.300000000]: Could not initialize robot simulation interface

This is the code in my xacro file relative to the camera joints

<!-- Base link / Camera Link joint Z-->
  <joint name="camera_joint_z" type="prismatic">
    <parent link="base_link"/>
    <child link="camera_link"/>
    <origin xyz="-0.07 0 0.875" rpy="0 0 0"/>
    <axis xyz="0 0 1"/>
    <limit effort="1000.0" lower="-0.2" upper="0.2" velocity="0.5"/>
  </joint>


<!-- Camera transmission Z-->
  <transmission name="camera_trans_z">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="camera_joint_z">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="cameraMotorZ">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalWhiteuction>1</mechanicalWhiteuction>
    </actuator>
  </transmission>

<!-- Base link / Camera Link joint Y-->
  <joint name="camera_joint_y" type="prismatic">
    <parent link="base_link"/>
    <child link="camera_link"/>
    <origin xyz="-0.07 0 0.875" rpy="0 0 0"/>
    <axis xyz="0 1 0"/>
    <limit effort="1000.0" lower="-0.2" upper="0.2" velocity="0.5"/>
  </joint>


<!-- Camera transmission Y-->
  <transmission name="camera_trans_y">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="camera_joint_y">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="cameraMotorY">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalWhiteuction>1</mechanicalWhiteuction>
    </actuator>
  </transmission>

And this is the plugin inside the xacro

<!-- Camera Plugin-->
  <gazebo reference="camera_link">
    <sensor type="camera" name="tablet_camera">
      <update_rate>30.0</update_rate>
      <camera name="tablet_camera">
        <horizontal_fov>1.3962634</horizontal_fov>
        <image>
          <width>800</width>
          <height>800</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.02</near>
          <far>300</far>
        </clip>
        <noise>
          <type>gaussian</type>
          <!-- Noise is sampled independently per pixel on each frame.
               That pixel's noise value is added to each of its color
               channels, which at that point lie in the range [0,1]. -->
          <mean>0.0</mean>
          <stddev>0.007</stddev>
        </noise>
      </camera>
      <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>0.0</updateRate>
        <cameraName>tablet_camera</cameraName>
        <imageTopicName>image_raw</imageTopicName>
        <cameraInfoTopicName>camera_info</cameraInfoTopicName>
        <frameName>camera_link</frameName>
        <hackBaseline>0.07</hackBaseline>
        <distortionK1>0.0</distortionK1>
        <distortionK2>0.0</distortionK2>
        <distortionK3>0.0</distortionK3>
        <distortionT1>0.0</distortionT1>
        <distortionT2>0.0</distortionT2>
      </plugin>
    </sensor>
  </gazebo>

Of course I've ... (more)

edit retag flag offensive close merge delete

Comments

I think you'll have more luck getting answers to this over at the Gazebo answer site: answers.gazebosim.org.

gvdhoorn gravatar image gvdhoorn  ( 2016-11-18 00:45:05 -0500 )edit