Drake Parser error: Unable to read the 'value' attribute for the <drake:hunt_crossley_dissipation> tag - drake

I am trying to write a URDF file for a simple pendulum that will act as a 'paddle' - i.e. upon collision with a bouncy ball, the ball will bounce off (like a volleyball player passing a volleyball).
Inspired by this bouncy ball example, I have written the URDF file given below, but loading it with parser.AddModelFromFile("filename.urdf") gives this error:
RuntimeError: filename.urdf:39: error: Unable to read the 'value' attribute for the <drake:hunt_crossley_dissipation> tag
I am surprised that this doesn't work, since it was adapted from the bouncing ball example (which does work). I would really appreciate any guidance, thanks!
URDF file:
<?xml version="1.0"?>
<robot name="pendulum-paddle">
<material name="black">
<color rgba="0 0 0 1" />
</material>
<link name="base">
<inertial>
<origin xyz="0 0 0" />
<mass value="0.01" />
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0" />
</inertial>
</link>
<joint name="base_weld" type="fixed">
<parent link="world" />
<child link="base" />
</joint>
<link name="arm">
<inertial>
<origin xyz="0 0 -1" rpy="0 0 0" />
<mass value="1" />
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
</inertial>
<visual>
<origin xyz="0 0 -.5" rpy="0 0 0" />
<geometry>
<box size="0.2 0.2 1"/>
</geometry>
<material name="black" />
</visual>
<collision name="collision">
<origin xyz="0 0 -.5" rpy="0 0 0" />
<geometry>
<box size="0.2 0.2 1"/>
</geometry>
<drake:proximity_properties>
<drake:hunt_crossley_dissipation>
0.1
</drake:hunt_crossley_dissipation>
<drake:point_contact_stiffness>
1000000
</drake:point_contact_stiffness>
</drake:proximity_properties>
</collision>
</link>
<joint name="shoulder" type="continuous">
<parent link="base"/>
<child link="arm" />
<axis xyz="0 1 0" />
</joint>
<transmission type="SimpleTransmission" name="shoulder_trans">
<actuator name="shoulder" />
<joint name="shoulder" />
<mechanicalReduction>1</mechanicalReduction>
</transmission>
</robot>

Unfortunately, the syntax is URDF is different than in SDF, and we tried to make the Drake tags comply to the standard.
https://drake.mit.edu/doxygen_cxx/group__multibody__parsing.html#tag_drake_hunt_crossley_dissipation
In urdf, the proximity properties look more like:
<drake:proximity_properties>
<drake:mu_static value="0.8"/>
<drake:mu_dynamic value="0.3"/>
</drake:proximity_properties>
so try
<drake:proximity_properties>
<drake:hunt_crossley_dissipation value="0.1"/>
<drake:point_contact_stiffness value="1000000"/>
</drake:proximity_properties>

Related

Gazebo 4 Wheeled Robot does not move

I made a URDF-File for a 4-wheeled Robot. I would like to test it in Gazebo. I have it working so far. I have 4 wheels, they also turn. I confirmed this by turning on View -> Wireframe. I am using the skid_steer_drive_controller and rosrun teleop_twist_keyboard teleop_twist_keyboard.py. I can see the wheels turning but the Robot does not move.
I am using an offset for my base_footprint, otherwise my robot collapses and starts jiggeling. I also took this offset in the z-Axis in account for the wheels.
I took this urdf as basis, here so i did not declare friction:
This is my URDF:
<?xml version="1.0" ?>
<robot name="explorer">
<link name="world">
</link>
<!-- -->
<link name="base_footprint">
<visual>
<origin xyz="0 0 0.046"/>
<geometry>
<box size="0.235 0.094 0.049"/>
</geometry>
<material name="gray">
<color rgba=".2 .2 .2 1" />
</material>
</visual>
<inertial>
<origin xyz="0 0 0.046"/>
<mass value="0.6174" />
<inertia ixx="2.84523645e-3" ixy="0.0" ixz="0" iyy="3.1763172e-3" iyz="0" izz="5.7814365e-4" />
</inertial>
<collision>
<origin xyz="0 0 0.046"/>
<geometry>
<box size="0.235 0.094 0.049"/>
</geometry>
</collision>
</link>
<joint name="dummy_joint" type="fixed">
<parent link="world"/>
<child link="base_footprint"/>
</joint>
<!-- -->
<link name="wheel_rf">
<inertial>
<mass value="0.036" />
<inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
</inertial>
<visual>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
</collision>
</link>
<joint name="wheel_rf_joint" type="continuous">
<origin xyz="0.04 0.063 0.033" rpy="1.57 0.0 0.0"/>
<parent link="base_footprint"/>
<child link="wheel_rf"/>
<axis xyz="0.0 0.0 1.0"/>
</joint>
<link name="wheel_lf">
<inertial>
<mass value="0.036" />
<inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
</inertial>
<visual>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
</collision>
</link>
<joint name="wheel_lf_joint" type="continuous">
<origin xyz="0.04 -0.063 0.033" rpy="1.57 0.0 0.0"/>
<parent link="base_footprint"/>
<child link="wheel_lf"/>
<axis xyz="0.0 0.0 1.0"/>
</joint>
<!-- -->
<link name="wheel_rb">
<inertial>
<mass value="0.036" />
<inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
</inertial>
<visual>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
</collision>
</link>
<joint name="wheel_rb_joint" type="continuous">
<origin xyz="-0.04 0.063 0.033" rpy="1.57 0.0 0.0"/>
<parent link="base_footprint"/>
<child link="wheel_rb"/>
<axis xyz="0.0 0.0 1.0"/>
</joint>
<!-- -->
<link name="wheel_lb">
<inertial>
<mass value="0.036" />
<inertia ixx="9.2562e-5" ixy="0.0" ixz="0" iyy="9.2562e-5" iyz="0" izz="2.9124e-5" />
</inertial>
<visual>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
<material name="white">
<color rgba="1 1 1 1"/>
</material>
</visual>
<collision>
<geometry>
<cylinder radius="0.033" length="0.026"/>
</geometry>
</collision>
</link>
<joint name="wheel_lb_joint" type="continuous">
<origin xyz="-0.04 -0.063 0.033" rpy="1.57 0.0 0.0"/>
<parent link="base_footprint"/>
<child link="wheel_lb"/>
<axis xyz="0.0 0.0 1.0"/>
</joint>
<!-- Gazebo colors to links as upper defined colors are only visible in RVIZ-->
<gazebo reference="base_footprint">
<material>Gazebo/Black</material>
</gazebo>
<gazebo reference="wheel_rf">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="wheel_lf">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="wheel_rb">
<material>Gazebo/Orange</material>
</gazebo>
<gazebo reference="wheel_lb">
<material>Gazebo/Orange</material>
</gazebo>
<!-- DIFFENERNTIAL DRIVEEEEEEEEEEEEE -->
<gazebo>
<plugin name="skid_steer_drive_controller" filename="libgazebo_ros_skid_steer_drive.so">
<updateRate>100.0</updateRate>
<robotNamespace>/</robotNamespace>
<leftFrontJoint>wheel_lf_joint</leftFrontJoint>
<rightFrontJoint>wheel_rf_joint</rightFrontJoint>
<leftRearJoint>wheel_lb_joint</leftRearJoint>
<rightRearJoint>wheel_rb_joint</rightRearJoint>
<wheelSeparation>0.08</wheelSeparation>
<wheelDiameter>0.066</wheelDiameter>
<robotBaseFrame>base_footprint</robotBaseFrame>
<torque>20</torque>
<topicName>cmd_vel</topicName>
<broadcastTF>false</broadcastTF>
</plugin>
</gazebo>
</robot>

Camera in Gazebo changes view continuously

I'm trying to attach a simple camera to the tool tip of my robot (Kuka lwr). The problem is that the camera view is always changing as shown in the video:
https://polimi365-my.sharepoint.com/:v:/g/personal/10522502_polimi_it/EXuBinkz9NRJlq9O5L5lSo8B7VvdVAVFOAfmaITn106_4A?e=6i3bw3
It seems like the camera is colliding with something or there is a sort of conflict. At the beginning I though it was a material problem (maybe the camera was set inside the box) but setting it transparent didn't solve the problem. I couldn't find any similar issue on the web so I hope someone can help me! For the camera, I followed the tutorial (http://gazebosim.org/tutorials?tut=ro...) adding the camera description in my .urdf.xacro file and the camera plugin in the .gazebo.xacro file.
Here is the camera description in the xacro file:
<joint name="${name}_joint_camera" type="fixed">
<parent link="tool_ee"/>
<child link="${name}_link_camera"/>
<origin xyz="0 0 0.06" rpy="0 0 0"/>
<axis xyz="1 0 0" />
</joint>
<link name="${name}_link_camera">
<collision>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="0.05 0.05 0.05"/>
</geometry>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<box size="0.05 0.05 0.05"/>
</geometry>
</visual>
<inertial>
<mass value="1e-5" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.0001" iyz="0" izz="0.0001" />
</inertial>
</link>
<joint name="camera_optical_joint" type="fixed">
<origin xyz="0 0 0" rpy="${-pi/2} 0 ${-pi/2}"/>
<parent link="${name}_link_camera"/>
<child link="camera_link_optical"/>
</joint>
<link name="camera_link_optical">
</link>
Here the camera plugin of in the gazebo file:
<gazebo reference="lwr_link_camera">
<mu1>0.2</mu1>
<mu2>0.2</mu2>
<material>Gazebo/Transparent</material>
</gazebo>
<!-- Camera -->
<gazebo reference="lwr_link_camera">
<sensor type="camera" name="camera_sensor1">
<update_rate>30.0</update_rate>
<camera name="head">
<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>/camera1</cameraName>
<imageTopicName>image_raw</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>camera_link_optical</frameName>
<hackBaseline>0.0</hackBaseline>
<distortionK1>0.0</distortionK1>
<distortionK2>0.0</distortionK2>
<distortionK3>0.0</distortionK3>
<distortionT1>0.0</distortionT1>
<distortionT2>0.0</distortionT2>
<CxPrime>0</CxPrime>
<Cx>0.0</Cx>
<Cy>0.0</Cy>
<focalLength>0.0</focalLength>
</plugin>
</sensor>
</gazebo>
Any help is appreciated! Thanks!

ROS - problem adding ultrasonic data to range_sensor_layer

I need some help with a problem I encountered while adding ultrasonic sensors to a robot (loosely based on Linorobot), already equipped with an RPlidar. Hw/Sw: Raspi3B w/ Ubuntu 16.04.6 LTS, ROS kinetic, a Teensy, 2 Nano.
The robot was working fine with just the lidar, but I need to be able to detect correctly glass and some reflective surfaces, so I'm adding the ultrasonic sensors.
The hardware and microcontroller (rosserial) parts seem to be working fine, I suspect it's an error from my part, maybe related to namespaces or transform frames... or maybe I'm missing something gargantuan. I checked and re-checked against online tutorials, examples and other questions similar to this one, but I couldn't identify the culprit.
After executing the launch files I get the standard messages (same as before trying to setup the ultrasonic sensors), plus:
[ INFO] [1631195261.554945536]: global_costmap/sonar_layer: ALL as input_sensor_type given
[ INFO] [1631195261.596176257]: RangeSensorLayer: subscribed to topic /ultrasound_front
and I guess that's good.
Unfortunately from that moment onward I get (with increasingly high figures, of course):
[ WARN] [1631195265.533631740]: No range readings received for 4.02 seconds, while expected at least every 2.00 seconds.
here's a sensor message (from "rostopic echo /ultrasound_front"):
----
header:
seq: 1124
stamp:
secs: 1631192726
nsecs: 301432058
frame_id: "sonar_front"
radiation_type: 0
field_of_view: 0.259999990463
min_range: 0.0
max_range: 100.0
range: 52.0
----
So, the topic is published and the massages should be ok...
My costmap_common_params.yaml:
map_type: costmap
transform_tolerance: 1
footprint: [[-0.25, -0.25], [-0.25, 0.25], [0.25, 0.25], [0.25, -0.25]]
inflation_layer:
inflation_radius: 0.28
cost_scaling_factor: 3
obstacle_layer:
obstacle_range: 2.5
raytrace_range: 3.0
observation_sources: scan
observation_persistence: 0.0
scan:
data_type: LaserScan
topic: scan
marking: true
clearing: true
sonar_layer:
frame: sonar_front
topics: ["/ultrasound_front"]
no_readings_timeout: 2.0
clear_on_max_reading: true
clear_threshold: 0.2
mark_threshold: 0.80
My global_costmap_params.yaml:
global_costmap:
global_frame: /map
robot_base_frame: /base_footprint
update_frequency: 1
publish_frequency: 0.5
static_map: true
transform_tolerance: 1
plugins:
- {name: static_layer, type: "costmap_2d::StaticLayer"}
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
My local_costmap_params.yaml:
local_costmap:
global_frame: /odom
robot_base_frame: /base_footprint
update_frequency: 1
publish_frequency: 5.0
static_map: false
rolling_window: true
width: 3
height: 3
resolution: 0.02
transform_tolerance: 1
observation_persistence: 0.0
plugins:
- {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
- {name: sonar_layer, type: "range_sensor_layer::RangeSensorLayer"}
- {name: inflation_layer, type: "costmap_2d::InflationLayer"}
And my barebone URDF:
<?xml version="1.0"?>
<robot name="linorobot">
<link name="base_link">
<visual>
<geometry>
<box size="0.50 0.33 0.09"/>
</geometry>
<origin rpy="0 0 0" xyz="0.0 0.00 0.085"/>
<material name="blue">
<color rgba="0 0 .8 1"/>
</material>
</visual>
</link>
<link name="perception_deck">
<visual>
<geometry>
<box size="0.18 0.33 0.08"/>
</geometry>
<origin rpy="0 0 0" xyz="0.0 0.0 0.17"/>
<material name="blue">
<color rgba="0 0 .8 1"/>
</material>
</visual>
</link>
<link name="wheel_left_front">
<visual>
<geometry>
<cylinder length="0.03" radius="0.06"/>
</geometry>
<origin rpy="1.57 0 0" xyz="0.163 0.222 0.03"/>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
<link name="wheel_right_front">
<visual>
<geometry>
<cylinder length="0.03" radius="0.06"/>
</geometry>
<origin rpy="1.57 0 0" xyz="0.163 -0.222 0.03"/>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
<link name="wheel_left_rear">
<visual>
<geometry>
<cylinder length="0.03" radius="0.06"/>
</geometry>
<origin rpy="1.57 0 0" xyz="-0.163 0.222 0.03"/>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
<link name="wheel_right_rear">
<visual>
<geometry>
<cylinder length="0.03" radius="0.06"/>
</geometry>
<origin rpy="1.57 0 0" xyz="-0.163 -0.222 0.03"/>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
</visual>
</link>
<link name="laser">
<visual>
<geometry>
<cylinder length="0.065" radius="0.035"/>
</geometry>
<origin rpy="0 0 0" xyz="0.0 0.0 0.2825"/>
<material name="black"/>
</visual>
</link>
<link name="chassis">
<visual>
<geometry>
<box size="0.5 0.5 0.8"/>
</geometry>
<origin rpy="0 0 0" xyz="0.0 0.0 0.0"/>
<material name="silver">
<color rgba="192 192 192 0.6"/>
</material>
</visual>
</link>
<link name="sonar_front">
<visual>
</geometry>
<origin rpy="1.5708 0.2618 0" xyz="-0.21 0.0 0.235"/>
<material name="silver">
<color rgba="192 192 192 0.6"/>
</material>
</visual>
</link>
<link name="sonar_rear">
<visual>
<geometry>
<box size="0.02 0.025 0.07"/>
</geometry>
<origin rpy="1.5708 0.2618 3.1416" xyz="0.23 0.0 0.235"/>
<material name="silver">
<color rgba="192 192 192 0.6"/>
</material>
</visual>
</link>
<link name="sonar_left">
<visual>
<geometry>
<box size="0.02 0.025 0.07"/>
</geometry>
<origin rpy="1.5708 -0.2618 1.5708" xyz="0.0 0.18 0.235"/>
<material name="silver">
<color rgba="192 192 192 0.6"/>
</material>
</visual>
</link>
<link name="sonar_right">
<visual>
<geometry>
<box size="0.02 0.025 0.07"/>
</geometry>
<origin rpy="1.5708 -0.2618 -1.5708" xyz="0.0 -0.19 0.235"/>
<material name="silver">
<color rgba="192 192 192 0.6"/>
</material>
</visual>
</link>
<joint name="base_to_wheel_left_front" type="fixed">
<parent link="base_link"/>
<child link="wheel_left_front"/>
<origin xyz="0 0 0"/>
</joint>
<joint name="base_to_wheel_right_front" type="fixed">
<parent link="base_link"/>
<child link="wheel_right_front"/>
<origin xyz="0 0 0"/>
</joint>
<joint name="base_to_wheel_left_rear" type="fixed">
<parent link="base_link"/>
<child link="wheel_left_rear"/>
<origin xyz="0 0 0"/>
</joint>
<joint name="base_to_wheel_right_rear" type="fixed">
<parent link="base_link"/>
<child link="wheel_right_rear"/>
<origin xyz="0 0 0"/>
</joint>
<joint name="base_to_laser" type="fixed">
<parent link="base_link"/>
<child link="laser"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_left_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_left"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_right_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_right"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_rear_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_rear"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_front_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_front"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_perception_deck" type="fixed">
<parent link="base_link"/>
<joint name="base_to_laser" type="fixed">
<parent link="base_link"/>
<child link="laser"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_left_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_left"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_right_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_right"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_rear_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_rear"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_front_sonar" type="fixed">
<parent link="base_link"/>
<child link="sonar_front"/>
<origin xyz="0.0 0.0 0.0"/>
</joint>
<joint name="base_to_perception_deck" type="fixed">
<parent link="base_link"/>
<child link="perception_deck"/>
<origin xyz="0 0 0.0"/>
</joint>
<joint name="base_to_chassis" type="fixed">
<parent link="base_link"/>
<child link="chassis"/>
<origin xyz="0 0 0.44"/>
</joint>
</robot>
Thanks!
EDITS
after getting the messages, "rostopic hz /ultrasound_front" gives:
subscribed to [/ultrasound_front]
average rate: 3.494
min: 0.267s max: 0.305s std dev: 0.01919s window: 3
average rate: 3.384
min: 0.250s max: 0.353s std dev: 0.03533s window: 6
average rate: 3.362
min: 0.250s max: 0.353s std dev: 0.02813s window: 9
average rate: 3.352
min: 0.250s max: 0.353s std dev: 0.02625s window: 13
average rate: 3.349
min: 0.250s max: 0.353s std dev: 0.02447s window: 16
average rate: 3.344
min: 0.250s max: 0.353s std dev: 0.02547s window: 20
average rate: 3.341
min: 0.250s max: 0.353s std dev: 0.02368s window: 23
average rate: 3.256
min: 0.250s max: 0.490s std dev: 0.04349s window: 26
average rate: 3.336
min: 0.110s max: 0.490s std dev: 0.05406s window: 30
average rate: 3.335
min: 0.110s max: 0.490s std dev: 0.05176s window: 33
and so on. Publishing interval in the MCU code is 250ms.
"max_range:1.0" in "rostopic echo /ultrasound_front" has been corrected (was an error in the original MCU code), the behaviour doesn't change. I modified the output above to reflect the current version.
"rostopic info /ultrasound_front", after the massages started, gives: (Thank you #BTables!)
Type: sensor_msgs/Range
Publishers:
* /rosserial_NANO_sensors (http://192.168.2.54:34525/)
Subscribers:
* /move_base (http://192.168.2.54:40149/)
I finally solved some of the problems that emerged after adding the ultrasound sensors. Because of the nature of the errors, and the extremely large amount of different hw/sw configurations possible, I will put here my findings, with some more general info, hoping to help others:
Double check the UNIT of MEASURE used in the range fields in the microcontroller code. For example, the library and examples I used and referred to had everything in cm.
This isn't good for ROS navigation layer, the range/distance numbers passed in the messages should be in meters (min_range, max_range, range).
HOWEVER the microcontroller code could be passing the data, and using some internal calculations or logic, in centimeters (like here 'https://www.intorobotics.com/how-to-use-sensor_msgs-range-ros-for-multiple-sensors-with-rosserial/', for example), so some changes are probably needed (also regarding the logic behind the clearing of the costmap, but that's a problem for another question).
A message rate of 20Hz should be ok, it should not produce missing data messages, sync errors, etc. However please note that it's possible this frequency has to be modified, depending on the hardware involved.
The costmap YAML parameter clear_on_max_reading behaviour depends on how the data is presented by your ultrasound sensor (or sensors) MCU code. It's a good idea to try both settings and check which one is more appropriate for your case. You can then modify the MCU code to accomodate for the library logic behind this setting (or the other way around, modifying the libraries).
Verify that your RVIZ configuration contains all the necessary information to visualize your ultrasound (range) sensor data (http://wiki.ros.org/rviz/DisplayTypes/Range)
The URDF usually gives clear messages if something related to the transforms and related data is not working, once the real problems are solved, it's possible to see the cones and axes in Rviz (IF the unit of measure isn't too small!), so it's easy to correct orientation and position errors.
Use check_urdf to verify the validity of the URDF file (http://wiki.ros.org/urdf#Verification), and urdf_to_graphiz to have a visual representation with some more data, that could give some clues on malfunctions or errors (http://wiki.ros.org/urdf#Visualization). Also rqt_graph with enable_statistics set to "true" can give useful clues (http://wiki.ros.org/rqt_graph).

Gazebo weird behavior when two objects contact

Hello Gazebo/ROS community on Stack Overflow, I'm trying to simulate the landing of a quadcopter on a pole using Gazebo/ROS Kinetic. However, as soon as the drone contacts the landing pole, it gets bounced away in a very unrealistic way. Both the drone and the pole have their mass, inertia, and friction defined.
A video is avaliable here:
https://youtu.be/8Iis60y5_yk
Can anyone give me a few pointers? Your help is much appreciated!
Here is the .world file:
<?xml version="1.0" ?>
<sdf version="1.4">
<world name="default">
<include>
<uri>model://ground_plane</uri>
</include>
<include>
<uri>model://sun</uri>
</include>
<!-- Only one ROS interface plugin is required per world, as any other plugin can connect a Gazebo
topic to a ROS topic (or vise versa). -->
<plugin name="ros_interface_plugin" filename="librotors_gazebo_ros_interface_plugin.so"/>
<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<latitude_deg>47.3667</latitude_deg>
<longitude_deg>8.5500</longitude_deg>
<elevation>500.0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
<physics type='ode'>
<ode>
<solver>
<type>quick</type>
<iters>1000</iters>
<sor>1.3</sor>
</solver>
<constraints>
<cfm>0</cfm>
<erp>0.2</erp>
<contact_max_correcting_vel>100</contact_max_correcting_vel>
<contact_surface_layer>0.001</contact_surface_layer>
</constraints>
</ode>
<max_step_size>0.01</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>100</real_time_update_rate>
<gravity>0 0 -9.8</gravity>
</physics>
</world>
</sdf>
Here is the xacro file for the landing pole:
<?xml version="1.0"?>
<robot name="target" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:property name="pole_height" value="1.2192" />
<xacro:property name="pole_radius" value="0.05" />
<!-- cone-shaped top compatible with the drone -->
<link name="target/cone">
<inertial>
<origin xyz="0 0 0"/>
<mass value="3.0"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://rotors_description/meshes/cone.dae" scale="0.001 0.001 0.001" />
</geometry>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://rotors_description/meshes/cone.dae" scale="0.001 0.001 0.001" />
</geometry>
<contact_coefficients mu ="1" kp="1000" kd="1"/>
</collision>
</link>
<!-- connect cone to pole -->
<joint name="cone_to_pole" type="fixed">
<origin xyz="0 0 0.6096"/>
<parent link="target/base_link"/>
<child link="target/cone"/>
</joint>
<!-- landing pole -->
<link name="target/base_link">
<visual>
<origin xyz="0 0 0" rpy="0 0 0"/>
<geometry>
<cylinder length="${pole_height}" radius="${pole_radius}"/>
</geometry>
<material name="white">
<color rgba="1.0 1.0 1.0 1.0"/>
</material>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<cylinder length="${pole_height}" radius="${pole_radius}"/>
</geometry>
</collision>
<inertial>
<origin xyz="0 0 0"/>
<mass value="3.0"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
</link>
<!-- april tag -->
<link name="target/tag_link">
<inertial>
<origin xyz="0 0 0"/>
<mass value="1.0"/>
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
</inertial>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<box size="1.7 1.7 0.05" />
</geometry>
<surface>
<friction>
<ode>
<mu>0.01</mu>
<mu2>0.01</mu2>
</ode>
</friction>
</surface>
</collision>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="package://rotors_description/meshes/pole.dae" scale="1 1 1" />
</geometry>
</visual>
</link>
<!-- connect pole to tag -->
<joint name="target/tag_joint" type="fixed">
<origin xyz="0 0 -0.6096"/>
<parent link="target/base_link"/>
<child link="target/tag_link"/>
</joint>
<!-- make the landing pole transparent for testing purposes -->
<!-- <gazebo reference="target/base_link">
<visual>
<material>
<ambient> 1.0 1.0 1.0 0.0</ambient>
<diffuse> 1.0 1.0 1.0 0.0</diffuse>
<specular>1.0 1.0 1.0 0.0</specular>
</material>
</visual>
</gazebo>
<gazebo reference="target/cone">
<visual>
<material>
<ambient> 1.0 1.0 1.0 0.0</ambient>
<diffuse> 1.0 1.0 1.0 0.0</diffuse>
<specular>1.0 1.0 1.0 0.0</specular>
</material>
</visual>
</gazebo> -->
<xacro:include filename="$(find rotors_description)/urdf/component_snippets.xacro" />
<xacro:default_imu namespace="target" parent_link="target/base_link" />
<gazebo>
<plugin name="landing_target_plugin" filename="librotors_gazebo_landing_target_plugin.so">
<robotNamespace>target</robotNamespace>
<linkName>target/base_link</linkName>
</plugin>
</gazebo>
<gazebo reference="target/base_link">
<mu1>0.00000001</mu1>
<mu2>0.00000001</mu2>
</gazebo>
</robot>
Here is the xacro file for the base of the drone:
<?xml version="1.0"?>
<!--
Copyright 2015 Fadri Furrer, ASL, ETH Zurich, Switzerland
Copyright 2015 Michael Burri, ASL, ETH Zurich, Switzerland
Copyright 2015 Mina Kamel, ASL, ETH Zurich, Switzerland
Copyright 2015 Janosch Nikolic, ASL, ETH Zurich, Switzerland
Copyright 2015 Markus Achtelik, ASL, ETH Zurich, Switzerland
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<!-- Macro for the inertia of a box -->
<xacro:macro name="box_inertia" params="x y z mass">
<inertia ixx="${0.0833333 * mass * (y*y + z*z)}" ixy="0.0" ixz="0.0"
iyy="${0.0833333 * mass * (x*x + z*z)}" iyz="0.0"
izz="${0.0833333 * mass * (x*x + y*y)}" />
</xacro:macro>
<!-- Macro for the inertial properties of a box -->
<xacro:macro name="box_inertial" params="x y z mass *origin">
<inertial>
<mass value="${mass}" />
<xacro:insert_block name="origin" />
<xacro:box_inertia x="${x}" y="${y}" z="${z}" mass="${mass}" />
</inertial>
</xacro:macro>
<!-- Main multirotor link -->
<xacro:macro name="multirotor_base_macro"
params="robot_namespace mass body_width body_height use_mesh_file mesh_file *inertia">
<link name="${robot_namespace}/base_link">
</link>
<joint name="${robot_namespace}/base_joint" type="fixed">
<origin xyz="0 0 0" rpy=" 0 0 0" />
<parent link="${robot_namespace}/base_link" />
<child link="${robot_namespace}/base_link_inertia" />
</joint>
<link name="${robot_namespace}/base_link_inertia">
<inertial>
<mass value="${mass}" /> <!-- [kg] -->
<origin xyz="0 0 0" />
<xacro:insert_block name="inertia" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<xacro:if value="${use_mesh_file}">
<mesh filename="${mesh_file}" scale="1 1 1" />
</xacro:if>
<xacro:unless value="${use_mesh_file}">
<box size="${body_width} ${body_width} ${body_height}"/> <!-- [m] [m] [m] -->
</xacro:unless>
</geometry>
</visual>
<collision>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<xacro:if value="${use_mesh_file}">
<mesh filename="${mesh_file}" scale="1 1 1" />
</xacro:if>
<xacro:unless value="${use_mesh_file}">
<box size="${body_width} ${body_width} ${body_height}"/> <!-- [m] [m] [m] -->
</xacro:unless>
</geometry>
<contact_coefficients mu ="1" kp="1000" kd="1"/>
</collision>
</link>
<!-- attach multirotor_base_plugin to the base_link -->
<gazebo>
<plugin filename="librotors_gazebo_multirotor_base_plugin.so" name="multirotor_base_plugin">
<robotNamespace>${robot_namespace}</robotNamespace>
<linkName>${robot_namespace}/base_link</linkName>
<rotorVelocitySlowdownSim>${rotor_velocity_slowdown_sim}</rotorVelocitySlowdownSim>
</plugin>
</gazebo>
</xacro:macro>
<!-- Rotor joint and link -->
<xacro:macro name="vertical_rotor"
params="robot_namespace suffix direction motor_constant moment_constant parent mass_rotor radius_rotor time_constant_up time_constant_down max_rot_velocity motor_number rotor_drag_coefficient rolling_moment_coefficient color use_own_mesh mesh *origin *inertia">
<joint name="${robot_namespace}/rotor_${motor_number}_joint" type="continuous">
<xacro:insert_block name="origin" />
<axis xyz="0 0 1" />
<!-- TODO(ff): not currently set because it's not yet supported -->
<!-- <limit effort="2000" velocity="${max_rot_velocity}" /> -->
<parent link="${parent}" />
<child link="${robot_namespace}/rotor_${motor_number}" />
</joint>
<link name="${robot_namespace}/rotor_${motor_number}">
<inertial>
<mass value="${mass_rotor}" /> <!-- [kg] -->
<xacro:insert_block name="inertia" />
</inertial>
<visual>
<geometry>
<!-- <cylinder length="0.005" radius="${radius_rotor}"/> --> <!-- [m] -->
<xacro:if value="${use_own_mesh}">
<mesh filename="${mesh}"
scale="1 1 1" />
</xacro:if>
<xacro:unless value="${use_own_mesh}">
<mesh filename="package://rotors_description/meshes/propeller_${direction}.dae"
scale="${radius_rotor} ${radius_rotor} ${radius_rotor}" /> <!-- The propeller meshes have a radius of 1m -->
<!-- <box size="${2*radius_rotor} 0.01 0.005"/> -->
</xacro:unless>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="0.005" radius="${radius_rotor}" /> <!-- [m] -->
</geometry>
</collision>
</link>
<gazebo>
<plugin name="${robot_namespace}_${suffix}_motor_model" filename="librotors_gazebo_motor_model.so">
<robotNamespace>${robot_namespace}</robotNamespace>
<jointName>${robot_namespace}/rotor_${motor_number}_joint</jointName>
<linkName>${robot_namespace}/rotor_${motor_number}</linkName>
<turningDirection>${direction}</turningDirection>
<timeConstantUp>${time_constant_up}</timeConstantUp>
<timeConstantDown>${time_constant_down}</timeConstantDown>
<maxRotVelocity>${max_rot_velocity}</maxRotVelocity>
<motorConstant>${motor_constant}</motorConstant>
<momentConstant>${moment_constant}</momentConstant>
<commandSubTopic>gazebo/command/motor_speed</commandSubTopic>
<motorNumber>${motor_number}</motorNumber>
<rotorDragCoefficient>${rotor_drag_coefficient}</rotorDragCoefficient>
<rollingMomentCoefficient>${rolling_moment_coefficient}</rollingMomentCoefficient>
<motorSpeedPubTopic>motor_speed/${motor_number}</motorSpeedPubTopic>
<rotorVelocitySlowdownSim>${rotor_velocity_slowdown_sim}</rotorVelocitySlowdownSim>
</plugin>
</gazebo>
<gazebo reference="${robot_namespace}/rotor_${motor_number}">
<material>Gazebo/${color}</material>
</gazebo>
</xacro:macro>
</robot>
I have faced a similar problem. The robot started to bounce when it was in contact with a surface. In my case, the source of problem was unrealistic inertia values of robot parts. Even if one of link has a bad calculated/estimated inertia, the model may bounce. I would propose you to verify calculations under inertial tags.

Multiple Realsense Cameras in URDF File

I have been working with ROS for only a couple weeks, sorry if i misunderstand things. I have made a URDF file with a robot in it. Now I wanted to add two Real-sense D435 cameras onto it so I can see it in Rviz. Following the test file given by Intel I got one camera to show up in the model however, when I try to create a second camera it just doesn't show up.
Question: How can I get two Real-sense cameras on my robot?
This is my URDF file:
<?xml version="1.0" ?>
<robot name="mrm" xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- BGN - Include -->
<xacro:include filename="$(find mrm_description)/urdf/robot_parameters.xacro" />
<xacro:include filename="$(find mrm_description)/urdf/links_joints.xacro" />
<xacro:include filename="$(find realsense2_camera)/urdf/_r435.urdf.xacro"/>
<xacro:include filename="$(find realsense2_camera)/urdf/_r430.urdf.xacro"/>
<m_link_box name="${link_00_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0"
mass="1024"
ixx="170.667" ixy="0" ixz="0"
iyy="170.667" iyz="0"
izz="170.667"
size="1 1 1" />
<m_joint name="${link_00_name}__${link_01_name}" type="revolute"
axis_xyz="0 0 1"
origin_rpy="0 0 0" origin_xyz="0 0 0.5"
parent="base_link" child="link_01"
limit_e="1000" limit_l="-3.14" limit_u="3.14" limit_v="0.5" />
<m_link_mesh name="${link_01_name}"
origin_rpy="0 0 0" origin_xyz="0 0 -0.1"
mass="157.633"
ixx="13.235" ixy="0" ixz="0"
iyy="13.235" iyz="0"
izz="9.655"
meshfile="package://mrm_description/meshes/Link1-v2.stl"
meshscale="0.001 0.001 0.001" />
<m_joint name="${link_01_name}__${link_02_name}" type="revolute"
axis_xyz="0 1 0"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
parent="link_01" child="link_02"
limit_e="1000" limit_l="0" limit_u="0.5" limit_v="0.5" />
<m_link_cylinder name="${link_02_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
mass="57.906"
ixx="12.679" ixy="0" ixz="0"
iyy="12.679" iyz="0"
izz="0.651"
radius="0.15" length="0.8" />
<m_joint name="${link_02_name}__${link_03_name}" type="revolute"
axis_xyz="0 1 0"
origin_rpy="0 0 0" origin_xyz="0 0 0.8"
parent="link_02" child="link_03"
limit_e="1000" limit_l="0" limit_u="0.75" limit_v="0.5" />
<m_link_cylinder name="${link_03_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
mass="57.906"
ixx="12.679" ixy="0" ixz="0"
iyy="12.679" iyz="0"
izz="0.651"
radius="0.15" length="0.8" />
<m_joint name="${link_03_name}__${link_04_name}" type="revolute"
axis_xyz="0 1 0"
origin_rpy="0 0 0" origin_xyz="0 0 0.8"
parent="link_03" child="link_04"
limit_e="1000" limit_l="0" limit_u="0.75" limit_v="0.5" />
<m_link_cylinder name="${link_04_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.4"
mass="57.906"
ixx="12.679" ixy="0" ixz="0"
iyy="12.679" iyz="0"
izz="0.651"
radius="0.15" length="0.8" />
<m_joint name="${link_04_name}__${link_05_name}" type="revolute"
axis_xyz="0 0 1"
origin_rpy="0 0 0" origin_xyz="0 0 0.8"
parent="link_04" child="link_05"
limit_e="1000" limit_l="-3.14" limit_u="3.14" limit_v="0.5" />
<m_link_cylinder name="${link_05_name}"
origin_rpy="0 0 0" origin_xyz="0 0 0.125"
mass="18.056"
ixx="0.479" ixy="0" ixz="0"
iyy="0.479" iyz="0"
izz="0.204"
radius="0.15" length="0.25" />
<sensor_r435 name="Camera 1" parent="${link_05_name}">
<origin xyz="0 0 0" rpy="1 0 0"/>
</sensor_r435>
<sensor_r435 name="Camera 2" parent="${link_05_name}">
<origin xyz="0.17 0 0" rpy="0 0 0"/>
</sensor_r435>
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
</plugin>
</gazebo>
</robot>
Looks like the realsense xacro doesn't have a "name" parameter which you are supplying, so it doesn't seem to do anything. Ideally, you can modify the intel xacro line -
<xacro:macro name="sensor_d415" params="parent *origin">
to
<xacro:macro name="sensor_d415" params="sensor_name parent *origin">
then add ${sensor_name}to every link and frame name in the intel xacro. Thus when you include this xacro in your URDF with different sensor_name, you recreate the full description each time.
If you get this working cleanly, please do submit a pull request to the intel github page.
In the meantime while waiting for a response I made a second file and added 2 to the end of each variable and that worked. Of course I knew this was not a permanent solution and that I should just keep it to one file. Thanks to Vik I have a solution. I took all the variables from my second file and replaced them with ${sensor_name}. For some reason the camera doesn't show up in rviz anymore. I'm not given any error messages but they just disappeared. Are there any issues with my code that people can see?
<?xml version="1.0"?>
<!--
License: Apache 2.0. See LICENSE file in root directory.
Copyright(c) 2017 Intel Corporation. All Rights Reserved
This is the URDF model for the Intel RealSense 430 camera, in it's
aluminum peripherial evaluation case.
-->
<robot name="sensor_d4352" xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="sensor_d415" params="sensor_name parent *origin">
<xacro:property name="M_PI" value="3.1415926535897931" />
<!-- The following values are approximate, and the camera node
publishing TF values with actual calibrated camera extrinsic values -->
<xacro:property name="d435_cam_depth_to_left_ir_offset" value="0.0"/>
<xacro:property name="d435_cam_depth_to_right_ir_offset" value="-0.050"/>
<xacro:property name="d435_cam_depth_to_color_offset" value="0.015"/>
<!-- The following values model the aluminum peripherial case for the
D435 camera, with the camera joint represented by the actual
peripherial camera tripod mount -->
<xacro:property name="d435_cam_width" value="0.090"/>
<xacro:property name="d435_cam_height" value="0.025"/>
<xacro:property name="d435_cam_depth" value="0.02505"/>
<xacro:property name="d435_cam_mount_from_center_offset" value="0.0149"/>
<!-- The following offset is relative the the physical D435 camera peripherial
camera tripod mount -->
<xacro:property name="d435_cam_depth_px" value="${d435_cam_mount_from_center_offset}"/>
<xacro:property name="d435_cam_depth_py" value="0.0175"/>
<xacro:property name="d435_cam_depth_pz" value="${d435_cam_height/2}"/>
<material name="aluminum${sensor_name}">
<color rgba="0.5 0.5 0.5 1"/>
</material>
<!-- camera body, with origin at bottom screw mount -->
<joint name="camera_joint${sensor_name}" type="fixed">
<xacro:insert_block name="origin" />
<parent link="${parent}"/>
<child link="camera_bottom_screw_frame${sensor_name}" />
</joint>
<link name="camera_bottom_screw_frame${sensor_name}"/>
<joint name="camera_link_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_py} ${d435_cam_depth_pz}" rpy="0 0 0"/>
<parent link="camera_bottom_screw_frame${sensor_name}"/>
<child link="camera_link${sensor_name}" />
</joint>
<link name="camera_link${sensor_name}">
<visual>
<origin xyz="${d435_cam_mount_from_center_offset} ${-d435_cam_depth_py} 0" rpy="${M_PI/2} 0 ${M_PI/2}"/>
<geometry>
<!-- <box size="${d435_cam_width} ${d435_cam_height} ${d435_cam_depth}"/> -->
<mesh filename="package://realsense2_camera/meshes/d435.dae" />
<!--<mesh filename="package://realsense2_camera/meshes/d435/d435.dae" />-->
</geometry>
<material name="aluminum"/>
</visual>
<collision>
<origin xyz="0 ${-d435_cam_depth_py} 0" rpy="0 0 0"/>
<geometry>
<box size="${d435_cam_depth} ${d435_cam_width} ${d435_cam_height}"/>
</geometry>
</collision>
<inertial>
<!-- The following are not reliable values, and should not be used for modeling -->
<mass value="0.564" />
<origin xyz="0 0 0" />
<inertia ixx="0.003881243" ixy="0.0" ixz="0.0" iyy="0.000498940" iyz="0.0" izz="0.003879257" />
</inertial>
</link>
<!-- camera depth joints and links -->
<joint name="camera_depth_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="0 0 0"/>
<parent link="camera_link${sensor_name}"/>
<child link="camera_depth_frame${sensor_name}" />
</joint>
<link name="camera_depth_frame${sensor_name}"/>
<joint name="camera_depth_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_depth_frame${sensor_name}" />
<child link="camera_depth_optical_frame${sensor_name}" />
</joint>
<link name="camera_depth_optical_frame${sensor_name}"/>
<!-- camera left IR joints and links -->
<joint name="camera_left_ir_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_to_left_ir_offset} 0" rpy="0 0 0" />
<parent link="camera_depth_frame${sensor_name}" />
<child link="camera_left_ir_frame${sensor_name}" />
</joint>
<link name="camera_left_ir_frame${sensor_name}"/>
<joint name="camera_left_ir_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_left_ir_frame${sensor_name}" />
<child link="camera_left_ir_optical_frame${sensor_name}" />
</joint>
<link name="camera_left_ir_optical_frame${sensor_name}"/>
<!-- camera right IR joints and links -->
<joint name="camera_right_ir_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_to_right_ir_offset} 0" rpy="0 0 0" />
<parent link="camera_depth_frame${sensor_name}" />
<child link="camera_right_ir_frame${sensor_name}" />
</joint>
<link name="camera_right_ir_frame${sensor_name}"/>
<joint name="camera_right_ir_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_right_ir_frame${sensor_name}" />
<child link="camera_right_ir_optical_frame${sensor_name}" />
</joint>
<link name="camera_right_ir_optical_frame${sensor_name}"/>
<!-- camera color joints and links -->
<joint name="camera_color_joint${sensor_name}" type="fixed">
<origin xyz="0 ${d435_cam_depth_to_color_offset} 0" rpy="0 0 0" />
<parent link="camera_depth_frame" />
<child link="camera_color_frame${sensor_name}" />
</joint>
<link name="camera_color_frame${sensor_name}"/>
<joint name="camera_color_optical_joint${sensor_name}" type="fixed">
<origin xyz="0 0 0" rpy="${-M_PI/2} 0 ${-M_PI/2}" />
<parent link="camera_color_frame${sensor_name}" />
<child link="camera_color_optical_frame${sensor_name}" />
</joint>
<link name="camera_color_optical_frame"/>
</xacro:macro>
</robot>

Resources