-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PERCEPTION: Setting up sensors (#252)
* add macros to simulate sensors * add more params to yaml * add lidar at front
- Loading branch information
Showing
7 changed files
with
454 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
...ars_rover_drivetrain/uwrt_mars_rover_drivetrain_description/config/sensor_parameters.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
depth_camera: | ||
camera1: | ||
dim: | ||
length: 0.05 | ||
width: 0.05 | ||
height: 0.05 | ||
parent_link: chassis | ||
offset: | ||
x: 0.61 | ||
y: 0 | ||
z: 0 | ||
|
||
r_rot: 0 | ||
p_rot: 0 | ||
y_rot: 0 | ||
camera_properties: | ||
horizontal_fov: 1.047198 | ||
image: | ||
width: 640 | ||
height: 480 | ||
format: R8G8B8 | ||
clip: | ||
near: 0.05 | ||
far: 3 | ||
|
||
camera2: | ||
dim: | ||
length: 0.05 | ||
width: 0.05 | ||
height: 0.05 | ||
parent_link: chassis | ||
offset: | ||
x: -0.61 | ||
y: 0 | ||
z: 0 | ||
|
||
r_rot: 0 | ||
p_rot: 0 | ||
y_rot: 3.14159265359 | ||
camera_properties: | ||
horizontal_fov: 1.047198 | ||
image: | ||
width: 640 | ||
height: 480 | ||
format: R8G8B8 | ||
clip: | ||
near: 0.05 | ||
far: 3 | ||
|
||
lidar: | ||
lidar1: | ||
dim: | ||
length: 0.05 | ||
width: 0.05 | ||
height: 0.05 | ||
parent_link: chassis | ||
offset: | ||
x: 0.61 | ||
y: 0 | ||
z: 0.1 | ||
|
||
r_rot: 0 | ||
p_rot: 0 | ||
y_rot: 0 | ||
|
||
lidar_properties: | ||
update_rate: 5 | ||
scan: | ||
samples: 360 | ||
resolution: 1.000000 | ||
min_angle: 0.000000 | ||
max_angle: 6.280000 | ||
range: | ||
min: 0.120000 | ||
max: 3.5 | ||
resolution: 0.015000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
113 changes: 113 additions & 0 deletions
113
uwrt_mars_rover_drivetrain/uwrt_mars_rover_drivetrain_description/urdf/sensors.macro.xacro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0"?> | ||
<robot xmlns:xacro="http://wiki.ros.org/xacro"> | ||
|
||
<!-- import macros file --> | ||
<xacro:include filename="$(find uwrt_mars_rover_drivetrain_description)/urdf/drivetrain.macro.xacro"/> | ||
|
||
<xacro:macro name="generate_sensor_frame" params="sensor_params name"> | ||
<link name="${name}"> | ||
<xacro:identical_visual_collision> | ||
<identical_blocks> | ||
<geometry> | ||
<box size="${sensor_params['dim']['length']} ${sensor_params['dim']['width']} ${sensor_params['dim']['height']}"/> | ||
</geometry> | ||
<material name="blue"> | ||
<color rgba="0 0 0.8 1.0"/> | ||
</material> | ||
</identical_blocks> | ||
</xacro:identical_visual_collision> | ||
<xacro:default_inertial/> | ||
</link> | ||
|
||
<joint name="${sensor_params['parent_link']}_to_${name}" type="fixed"> | ||
<parent link="${sensor_params['parent_link']}"/> | ||
<child link="${name}"/> | ||
<origin xyz="${sensor_params['offset']['x']} ${sensor_params['offset']['y']} ${sensor_params['offset']['z']} " | ||
rpy="${sensor_params['offset']['r_rot']} ${sensor_params['offset']['p_rot']} ${sensor_params['offset']['y_rot']} "/> | ||
</joint> | ||
|
||
</xacro:macro> | ||
|
||
|
||
<xacro:macro name="default_depth_camera_frame" params="camera_link_name camera_props"> | ||
<gazebo reference="${camera_link_name}"> | ||
<sensor name="${camera_link_name}_sensor" type="depth"> | ||
<visualize>true</visualize> | ||
<update_rate>30.0</update_rate> | ||
<camera name="camera"> | ||
<horizontal_fov>${camera_props['horizontal_fov']}</horizontal_fov> | ||
<image> | ||
<width>${camera_props['image']['width']}</width> | ||
<height>${camera_props['image']['height']}</height> | ||
<format>${camera_props['image']['format']}</format> | ||
</image> | ||
<clip> | ||
<near>${camera_props['clip']['near']}</near> | ||
<far>${camera_props['clip']['far']}</far> | ||
</clip> | ||
</camera> | ||
<plugin name="depth_camera_controller" filename="libgazebo_ros_camera.so"> | ||
<cameraName>${camera_link_name}</cameraName> | ||
<imageTopicName>${camera_link_name}_ir/image_raw</imageTopicName> | ||
<cameraInfoTopicName>${camera_link_name}_ir/camera_info</cameraInfoTopicName> | ||
<depthImageTopicName>${camera_link_name}_depth/image_raw</depthImageTopicName> | ||
<depthImageCameraInfoTopicName>${camera_link_name}_depth/camera_info</depthImageCameraInfoTopicName> | ||
<pointCloudTopicName>${camera_link_name}_depth/points</pointCloudTopicName> | ||
<frameName>${camera_link_name}_optical_frame</frameName> | ||
|
||
<baseline>0.2</baseline> | ||
<alwaysOn>true</alwaysOn> | ||
<updateRate>0.0</updateRate> | ||
<frame_name>camera_depth_frame</frame_name> | ||
<pointCloudCutoff>0.5</pointCloudCutoff> | ||
<pointCloudCutoffMax>3.0</pointCloudCutoffMax> | ||
<distortionK1>0</distortionK1> | ||
<distortionK2>0</distortionK2> | ||
<distortionK3>0</distortionK3> | ||
<distortionT1>0</distortionT1> | ||
<distortionT2>0</distortionT2> | ||
<CxPrime>0</CxPrime> | ||
<Cx>0</Cx> | ||
<Cy>0</Cy> | ||
<focalLength>0</focalLength> | ||
<hackBaseline>0</hackBaseline> | ||
</plugin> | ||
</sensor> | ||
</gazebo> | ||
</xacro:macro> | ||
|
||
<xacro:macro name="default_lidar_frame" params="lidar_link_name lidar_props"> | ||
<gazebo reference="${lidar_link_name}"> | ||
<sensor name="${lidar_link_name}_sensor" type="ray"> | ||
<always_on>true</always_on> | ||
<visualize>true</visualize> | ||
<update_rate>${lidar_props['update_rate']}</update_rate> | ||
<ray> | ||
<scan> | ||
<horizontal> | ||
<samples>${lidar_props['scan']['samples']}</samples> | ||
<resolution>${lidar_props['scan']['resolution']}</resolution> | ||
<min_angle>${lidar_props['scan']['min_angle']}</min_angle> | ||
<max_angle>${lidar_props['scan']['max_angle']}</max_angle> | ||
</horizontal> | ||
</scan> | ||
<range> | ||
<min>${lidar_props['range']['min']}</min> | ||
<max>${lidar_props['range']['max']}</max> | ||
<resolution>${lidar_props['range']['resolution']}</resolution> | ||
</range> | ||
<noise> | ||
<type>gaussian</type> | ||
<mean>0.0</mean> | ||
<stddev>0.01</stddev> | ||
</noise> | ||
</ray> | ||
<plugin name="lidar_controller" filename="libgazebo_ros_ray_sensor.so"> | ||
<output_type>sensor_msgs/LaserScan</output_type> | ||
<frame_name>${lidar_link_name}</frame_name> | ||
</plugin> | ||
</sensor> | ||
</gazebo> | ||
</xacro:macro> | ||
|
||
</robot> |
Oops, something went wrong.