Open dlee640 opened 3 years ago
Hi I think the frame_id you provided doesn't match with your TF tree. Try
map_frame = "map", --ROS frame ID to use for publishing submaps
tracking_frame = "os_imu", --ROS frame ID of the frame tracked by SLAM algorithm
published_frame = "os_sensor", --ROS frame ID to use as child frame for publishing poses
Thank you for your response. I changed the parameter but I am having hard time visualizing the data. I also get error messages on rviz regarding transformation between map frame and other frames, despite the fact that I have specified static transform between map frame and base_link frame in the launch file (attached below as well). What is the issue? Also, why do I get blurry map image on my rviz?
My launch file (Please look at the last lines for static transform between map frame and base_link:
<launch>
<param name="/use_sim_time" value="true" />
<arg name="sensor_hostname" default="os-992106000190.local" doc="hostname or IP in dotted decimal form of the sensor"/>
<arg name="udp_dest" default="169.254.207.33" doc="hostname or IP where the sensor will send data packets"/>
<arg name="lidar_port" default="7502" doc="port to which the sensor should send lidar data"/>
<arg name="imu_port" default="7503" doc="port to which the sensor should send imu data"/>
<arg name="replay" default="false" doc="do not connect to a sensor; expect /os_node/{lidar,imu}_packets from replay"/>
<arg name="lidar_mode" default="1024x10" doc="resolution and rate: either 512x10, 512x20, 1024x10, 1024x20, or 2048x10"/>
<arg name="timestamp_mode" default="" doc="method used to timestamp measurements: TIME_FROM_INTERNAL_OSC, TIME_FROM_SYNC_PULSE_IN, TIME_FROM_PTP_1588"/>
<arg name="metadata" default="/home/slambox/ouster_slam_ws/os-992106000190.local.json" doc="override default metadata file for replays"/>
<arg name="viz" default="false" doc="whether to run a simple visualizer"/>
<arg name="image" default="false" doc="publish range/intensity/noise image topic"/>
<arg name="tf_prefix" default="" doc="namespace for tf transforms"/>
<arg name="arg carto_conf" default="/home/slambox/ouster_slam_ws/src/ouster_slam" doc="FilePath to your cartograppher configuration"/>
<node pkg="ouster_ros" name="os_node" type="os_node" output="screen" required="true">
<param name="~/lidar_mode" type="string" value="$(arg lidar_mode)"/>
<param name="~/timestamp_mode" type="string" value="$(arg timestamp_mode)"/>
<param name="~/replay" value="$(arg replay)"/>
<param name="~/sensor_hostname" value="$(arg sensor_hostname)"/>
<param name="~/udp_dest" value="$(arg udp_dest)"/>
<param name="~/lidar_port" value="$(arg lidar_port)"/>
<param name="~/imu_port" value="$(arg imu_port)"/>
<param name="~/metadata" value="$(arg metadata)"/>
</node>
<node pkg="ouster_ros" type="os_cloud_node" name="os_cloud_node" output="screen" required="true">
<remap from="~/os_config" to="/os_node/os_config"/>
<remap from="~/lidar_packets" to="/os_node/lidar_packets"/>
<remap from="~/imu_packets" to="/os_node/imu_packets"/>
<param name="~/tf_prefix" value="$(arg tf_prefix)"/>
<remap from="/os_cloud_node/imu" to="imu"/>
<remap from="/os_cloud_node/points" to="points2"/>
</node>
<param name="robot_description"
textfile="$(arg carto_conf)/urdf/os_sensor.urdf"/>
<node name="robot_state_publisher" pkg="robot_state_publisher"
type="robot_state_publisher" />
<node name="cartographer_node" pkg="cartographer_ros"
type="cartographer_node" args="
-configuration_directory $(arg carto_conf)/configuration_files
-configuration_basename os0_32.lua"
output="screen">
</node>
<node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"
type="cartographer_occupancy_grid_node" args="-resolution 0.1" />
<node name="rviz" pkg="rviz" type="rviz" required="true"
args="-d $(arg carto_conf)/configuration_files/demo_3d.rviz" />
<node pkg="tf" type="static_transform_publisher" name="base_to_map" args="0 0 0 0 0 0 base_link map 100" />
</launch>
My URDF file:
<?xml version="1.0"?>
<!--
Copyright 2016 The Cartographer Authors
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 name="os_sensor">
<material name="orange">
<color rgba="1.0 0.5 0.2 1" />
</material>
<material name="gray">
<color rgba="0.2 0.2 0.2 1" />
</material>
<link name="os_sensor" />
<link name="base_link" />
<joint name="sensor_link_joint" type="fixed">
<parent link="base_link" />
<child link="os_sensor" />
<origin xyz="0 0 0" rpy="0 0 0" />
</joint>
<!-- Published by OS0 -->
<link name="os_imu">
<visual>
<origin xyz="0.0 0.0 0.0" />
<geometry>
<box size="0.06 0.04 0.02" />
</geometry>
<material name="orange" />
</visual>
</link>
<link name="os_lidar">
<visual>
<origin xyz="0.0 0.0 0.0" />
<geometry>
<cylinder length="0.07" radius="0.05" />
</geometry>
<material name="gray" />
</visual>
</link>
<joint name="imu_link_joint" type="fixed">
<parent link="os_sensor" />
<child link="os_imu" />
<origin xyz="0.006253 -0.011775 0.007645" rpy="0 0 0" />
</joint>
<joint name="os_link_joint" type="fixed">
<parent link="os_sensor" />
<child link="os_lidar" />
<origin xyz="0.0 0.0 0.03618" rpy="0 0 3.14159" />
</joint>
</robot>
map
to base_link
frame should not be static.
This is the robot pose calculated by the SLAM.
I am not sure why you would use a static publisher for this!? That's what cartogapher is for.
I have Ouster OS0-32 3D lidar sensor and I am trying to use cartographer on the recorded data.
When I run:
roslaunch ouster_slam os0_slam.launch udp_hostname:=169.254.207.33 bag_filename:=/home/slambox/ouster_slam_ws/terrain_test.bag replay:=true metadata:=/home/slambox/ouster_slam_ws/os-992106000190.local.json carto_conf:=/home/slambox/ouster_slam_ws/src/ouster_slam
I get the following output & error:
I am pretty sure that its a problem that can be fixed by modifying frame parameter in .lua or .launch file.
Here is my .lua configuration file
and here is my .launch file
Can some one please guide me on what I am doing wrong? I believe
this part in .lua file is where the problem is. I have tried using 'base_link' but it doesn't work.
Here is my frames.pdf when I run the corresponding bag file from the lidar data.: