Git Product home page Git Product logo

Comments (4)

nilseuropa avatar nilseuropa commented on June 12, 2024

Hi,

curious, never tried it on Gazebo-9, but that sensor type should be supported. Would you care to share your URDF?

from realsense_ros_gazebo.

belal-ibrahim avatar belal-ibrahim commented on June 12, 2024

Hi, here is my xacro file:

 <?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">

  <!-- Import all Gazebo-customization elements, including Gazebo colors -->
  <xacro:include filename="$(find abb_robot_model)/urdf/abb_robot.gazebo.xacro"/>
  <xacro:include filename="$(find abb_robot_model)/urdf/_d435i.gazebo.xacro"/>
  <xacro:include filename="$(find abb_robot_model)/urdf/_d435i.urdf.xacro"/>
  <!--xacro:include filename="$(find abb_robot_model)/urdf/depthcam.xacro"/-->
  <xacro:include filename="$(find abb_robot_model)/urdf/tracker.xacro" />
  <!-- Import Transmissions -->
  <xacro:include filename="$(find abb_robot_model)/urdf/abb_robot.transmission.xacro"/>

  <!-- Include Utilities -->
  <xacro:include filename="$(find abb_robot_model)/urdf/utilities.xacro" />

  <!-- some constants -->
  <xacro:property name="safety_controller_k_pos" value="100" />
  <xacro:property name="safety_controller_k_vel" value="2" />
  <xacro:property name="joint_damping" value="0.5" />
  <xacro:property name="max_effort" value="300"/>
  <xacro:property name="max_velocity" value="10"/>
  <xacro:arg name="use_nominal_extrinsics" default="true" />
  <xacro:macro name="abb_robot" params="parent hardware_interface robot_name *origin">

  <!--joint between {parent} and mobilePlatform-->
    <joint name="${parent}_${robot_name}_joint" type="fixed">
      <xacro:insert_block name="origin"/>
      <parent link="${parent}"/>
      <child link="${robot_name}_mobilePlatform"/>
    </joint>

    <link name="${robot_name}_mobilePlatform">
      <inertial>
	<origin xyz="-2.4 0.92 -2.5" rpy="1.57 0 0"/>
	<mass value="2"/>
	<inertia ixx="0.001"  ixy="0"  ixz="0" iyy="0.001" iyz="0" izz="0.001" />
      </inertial>

      <visual>
	<origin xyz="-2.4 0.92 -2.5" rpy="1.57 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/tools/mobilePlatform.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

    </link>

    <!--joint between {parent} and link_0-->
    <joint name="${robot_name}_mobilePlatform" type="fixed">
      <xacro:insert_block name="origin"/>
      <parent link="${robot_name}_mobilePlatform"/>
      <child link="${robot_name}_link_0"/>
    </joint>

    <link name="${robot_name}_link_0">
      <inertial>
	<origin xyz="0 0 0" rpy="0 0 0"/>
	<mass value="0.050"/>
	<inertia ixx="0.001"  ixy="0"  ixz="0" iyy="0.001" iyz="0" izz="0.001" />
      </inertial>

      <visual>
	<origin xyz="-0.72643375 -0.395 0" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/link_0.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

      <collision>
	<origin xyz="-0.72643375 -0.395 0" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/collision/link_0_hull.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </collision>

      <self_collision_checking>
	<origin xyz="0 0 0" rpy="0 0 0"/>
	<geometry>
	  <capsule radius="0.15" length="0.25"/>
	</geometry>
      </self_collision_checking>

    </link>

    <!-- joint between link_0 and link_1 -->
    <joint name="${robot_name}_joint_1" type="revolute">
      <parent link="${robot_name}_link_0"/>
      <child link="${robot_name}_link_1"/>
      <origin xyz="0 0 0.630" rpy="0 0 0"/>
      <axis xyz="0 0 1"/>
      <limit lower="${-180.0 * PI / 180}" upper="${180.0 * PI / 180}"
	     effort="${max_effort}" velocity="${max_velocity}" />
      <safety_controller soft_lower_limit="${-179.5 * PI / 180}"
			 soft_upper_limit="${179.5 * PI / 180}"
			 k_position="${safety_controller_k_pos}"
			 k_velocity="${safety_controller_k_vel}"/>
      <dynamics damping="${joint_damping}"/>
    </joint>

    <link name="${robot_name}_link_1">
      <inertial>
	<origin xyz="0.0 0.0 0.0" rpy="0 0 0"/>
	<mass value="0.050"/>
	<inertia ixx="0.005"  ixy="0"  ixz="0" iyy="0.005" iyz="0" izz="0.005" />
      </inertial>

      <visual>
	<origin xyz="-0.331 -0.4645 -0.630" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/link_1.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

      <collision>
	<origin xyz="-0.331 -0.4645 -0.630" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/collision/link_1_hull.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </collision>
    </link>

    <!-- joint between link_1 and link_2 -->
    <joint name="${robot_name}_joint_2" type="revolute">
      <parent link="${robot_name}_link_1"/>
      <child link="${robot_name}_link_2"/>
      <origin xyz="0.60 0.0 0.0" rpy="0 0 0"/>
      <axis xyz="0 1 0"/>
      <limit lower="${-40.0 * PI / 180}" upper="${160.0 * PI / 180}"
	     effort="${max_effort}" velocity="${max_velocity}" />
      <safety_controller soft_lower_limit="${-39.5 * PI / 180}"
			 soft_upper_limit="${159.5 * PI / 180}"
			 k_position="${safety_controller_k_pos}"
			 k_velocity="${safety_controller_k_vel}"/>
      <dynamics damping="${joint_damping}"/>
    </joint>

    <link name="${robot_name}_link_2">
      <inertial>
	<origin xyz="0.0 0.060 0.0" rpy="0 0 0"/>
	<mass value="0.050"/>
	<inertia ixx="0.005"  ixy="0"  ixz="0" iyy="0.005" iyz="0" izz="0.005" />
      </inertial>

      <visual>
	<origin xyz="-.60 -.45 -.630" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/link_2.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

      <collision>
	<origin xyz="-.60 -.45 -.630" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/collision/link_2_hull.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </collision>
    </link>

    <!-- joint between link_2 and link_3 -->
    <joint name="${robot_name}_joint_3" type="revolute">
      <parent link="${robot_name}_link_2"/>
      <child link="${robot_name}_link_3"/>
      <origin xyz="0 0 1.280" rpy="0 0 0"/>
      <axis xyz="0 1 0"/>
      <limit lower="${-180.0 * PI / 180}" upper="${70.0 * PI / 180}"
	     effort="${max_effort}" velocity="${max_velocity}" />
      <safety_controller soft_lower_limit="${-179.5 * PI / 180}"
			 soft_upper_limit="${69.5 * PI / 180}"
			 k_position="${safety_controller_k_pos}"
			 k_velocity="${safety_controller_k_vel}"/>
      <dynamics damping="${joint_damping}"/>
    </joint>

    <link name="${robot_name}_link_3">
      <inertial>
	<origin xyz="0.030 0.020 0.0" rpy="0 0 0"/>
	<mass value="0.050"/>
	<inertia ixx="0.005"  ixy="0"  ixz="0" iyy="0.005" iyz="0" izz="0.005" />
      </inertial>

      <visual>
	<origin xyz="-.6 -.28 ${-.63-1.28}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/link_3.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

      <collision>
	<origin xyz="-.6 -.28 ${-.63-1.28}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/collision/link_3_hull.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </collision>
    </link>

    <!-- joint between link_3 and link_4 -->
    <joint name="${robot_name}_joint_4" type="revolute">
      <parent link="${robot_name}_link_3"/>
      <child link="${robot_name}_link_4"/>
      <origin xyz="0.0 0.0 0.20" rpy="0 0 0"/>
      <axis xyz="1 0 0"/>
      <limit lower="${-300.0 * PI / 180}" upper="${300.0 * PI / 180}"
	     effort="${max_effort}" velocity="${max_velocity}" />
      <safety_controller soft_lower_limit="${-299.5 * PI / 180}"
			 soft_upper_limit="${299.5 * PI / 180}"
			 k_position="${safety_controller_k_pos}"
			 k_velocity="${safety_controller_k_vel}"/>
      <dynamics damping="${joint_damping}"/>
    </joint>

    <link name="${robot_name}_link_4">
      <inertial>
	<origin xyz="0 0.067 0.034" rpy="0 0 0"/>
	<mass value="2.7"/>
	<inertia ixx="0.03"  ixy="0"  ixz="0" iyy="0.01" iyz="0" izz="0.029" />
      </inertial>

      <visual>
	<origin xyz="-.6 -0.187 ${-.63-1.28-.2}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/link_4.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

      <collision>
	<origin xyz="-.6 -0.187 ${-.63-1.28-.2}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/collision/link_4_hull.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </collision>
    </link>

    <!-- joint between link_4 and link_5 -->
    <joint name="${robot_name}_joint_5" type="revolute">
      <parent link="${robot_name}_link_4"/>
      <child link="${robot_name}_link_5"/>
      <origin xyz="1.142 0 0" rpy="0 0 0"/>
      <axis xyz="0 1 0"/>
      <limit lower="${-120.0 * PI / 180}" upper="${120.0 * PI / 180}"
	     effort="${max_effort}" velocity="${max_velocity}" />
      <safety_controller soft_lower_limit="${-119.5 * PI / 180}"
			 soft_upper_limit="${119.5 * PI / 180}"
			 k_position="${safety_controller_k_pos}"
			 k_velocity="${safety_controller_k_vel}"/>
      <dynamics damping="${joint_damping}"/>
    </joint>

    <link name="${robot_name}_link_5">
      <inertial>
	<origin xyz="0.0 0.0 0.055" rpy="0 0 0"/>
	<mass value="0.025"/>
	<inertia ixx="0.001"  ixy="0"  ixz="0" iyy="0.001" iyz="0" izz="0.001" />
      </inertial>

      <visual>
	<origin xyz="${-.6-1.142} -0.093 ${-.63-1.28-.2}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/link_5.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

      <collision>
	<origin xyz="${-.6-1.142} -0.093 ${-.63-1.28-.2}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/collision/link_5_hull.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </collision>
    </link>

    <!-- joint between link_5 and link_6 -->
    <joint name="${robot_name}_joint_6" type="revolute">
      <parent link="${robot_name}_link_5"/>
      <child link="${robot_name}_link_6"/>
      <origin xyz="0.20 0 0" rpy="0 0 0"/>
      <axis xyz="1 0 0"/>
      <limit lower="${-360.0 * PI / 180}" upper="${360.0 * PI / 180}"
	     effort="${max_effort}" velocity="${max_velocity}" />
      <safety_controller soft_lower_limit="${-359.5 * PI / 180}"
			 soft_upper_limit="${359.5 * PI / 180}"
			 k_position="${safety_controller_k_pos}"
			 k_velocity="${safety_controller_k_vel}"/>
      <dynamics damping="${joint_damping}"/>
    </joint>

    <link name="${robot_name}_link_6">
      <inertial>
	<origin xyz="0.0125 0.0 0.0" rpy="0 0 0"/>
	<mass value="0.010"/>
	<inertia ixx="0.001"  ixy="0"  ixz="0" iyy="0.001" iyz="0" izz="0.001" />
      </inertial>

      <visual>
	<origin xyz="${-.6-1.142-.2} -0.10 ${-.63-1.28-.2}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/visual/link_6.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </visual>

      <collision>
	<origin xyz="${-.6-1.142-.2} -0.10 ${-.63-1.28-.2}" rpy="0 0 0"/>
	<geometry>
	  <mesh filename="package://abb_robot_model/urdf/meshes/collision/link_6_hull.stl" scale="0.001 0.001 0.001"/>
	</geometry>
	<material name="Grey"/>
      </collision>
    </link>

    <joint name="${robot_name}_joint_endeffector" type="fixed">
      <parent link="${robot_name}_link_6"/>
      <child link="${robot_name}_link_endEffector"/>
      <origin xyz="0 0 0" rpy="0 0 0"/>
    </joint>

    <link name="${robot_name}_link_endEffector">
      <inertial>
    <origin xyz="0.0 0.0 0.0150" rpy="0 0 0"/>
    <mass value="0.010"/>
    <inertia ixx="000"  ixy="0"  ixz="0" iyy="0000" iyz="0" izz="000" />
        </inertial>
  
        <visual>
    <origin xyz="0 -0.003 0" rpy="0 0 0"/> <!-- x=front y=right z=up-->
    <geometry>
      <mesh filename="package://abb_robot_model/urdf/meshes/visual/tools/gripper.stl" />
    </geometry>
    <material name="Grey"/>
        </visual>
      </link>
   
     <xacro:sensor_d435i parent="${robot_name}_link_endEffector" use_nominal_extrinsics="$(arg use_nominal_extrinsics)">
        <origin xyz="0.09 -0.003 0.1" rpy="0 0 0"/>  
      </xacro:sensor_d435i>
    
      <xacro:realsense_T265 sensor_name="camerat265" parent_link="${robot_name}_link_endEffector" rate="30">
        <origin rpy="0 0 0" xyz="0.09 -0.005 0.05"/>
       </xacro:realsense_T265> 
       <!-- for testing purposes with different nominal extrinsics>
       <xacro:macro name="sensor_d435i" params="parent *origin name:=camera use_nominal_extrinsics:=false">
      <xacro:sensor_d435 parent="${robot_name}_link_endEffector" name="${name}" use_nominal_extrinsics="${use_nominal_extrinsics}">
      <xacro:insert_block name="origin" />
      </xacro:sensor_d435>
      <xacro:d435i_imu_modules name="${robot_name}_link_endEffector" use_nominal_extrinsics="${use_nominal_extrinsics}"/>
    </xacro:macro--> 
      <!--xacro:realsense_d435 sensor_name="d435" parent_link="${robot_name}_link_endEffector" rate="10">
        <origin rpy="0 0 0 " xyz="0.09 -0.003 0.1"/>
      </xacro:realsense_d435--> 
    <!--Extensions -->
    <xacro:abb_robot_gazebo robot_name="${robot_name}" />
    <xacro:abb_robot_transmission hardware_interface="${hardware_interface}"/>

  </xacro:macro>

</robot>

from realsense_ros_gazebo.

belal-ibrahim avatar belal-ibrahim commented on June 12, 2024

most of the files in this link (https://bit.ly/2ILPflh)

from realsense_ros_gazebo.

janchk avatar janchk commented on June 12, 2024

The one of the possible causes to that problem may be the absence of some ROS packages such as ros-*distroname*-sensor-msgs.

from realsense_ros_gazebo.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.