isaac_ros_visual_slam: Parameter `input_base_frame` not working: base -> camera transform not taken into account?
Hi, first of all many thanks for sharing this great repository! Unfortunately I am having some issues obtaining odometry messages that account for the transformation between the robot and camera coordinate frames.
I am currently working with a ground robot and trying to track its position using a Realsense camera positioned on top of the robot, looking slightly down as so:
From the documentation, I seem to understand that your implementation is designed to allow tracking successive poses of the robot (i.e. frame base_link
), despite computing these poses in the camera frame (i.e. frame front_camera_link
). Namely, the Visual Odometry node parameter input_base_frame
seems to be responsible for this:
input_base_frame
: Name of the frame (baselink) to calculate transformation between the baselink and the left camera. Default is empty, which means the value of the base_frame will be used. If input_base_frame and base_frame are both empty, the left camera is assumed to be in the robot’s center.
However, by launching the node with 'input_base_frame': 'base_link'
as follows:
visual_slam_node = ComposableNode(
name='visual_slam_node',
namespace='front_camera',
package='isaac_ros_visual_slam',
plugin='isaac_ros::visual_slam::VisualSlamNode',
parameters=[{
'enable_rectified_pose': True,
'denoise_input_images': False,
'rectified_images': True,
'enable_debug_mode': False,
'debug_dump_path': '/tmp/elbrus',
'enable_slam_visualization': True,
'enable_landmarks_view': True,
'enable_observations_view': True,
'publish_tf': False,
'map_frame': 'map',
'odom_frame': 'odom',
'base_frame': 'base_link',
'input_base_frame': 'base_link',
'input_left_camera_frame': 'front_camera_infra1_frame',
'input_right_camera_frame': 'front_camera_infra2_frame',
}],
remappings=[('stereo_camera/left/image', 'infra1/image_rect_raw'),
('stereo_camera/left/camera_info', 'infra1/camera_info'),
('stereo_camera/right/image', 'infra2/image_rect_raw'),
('stereo_camera/right/camera_info', 'infra2/camera_info')]
)
the camera position with respect to the robot frame does not seem to be taken into account. As a matter of fact, unless I am mistaken it seems that the ROS parameter input_base_frame
is not used at all in the source code.
Here is an example where I start the VO tracking, and move the hand-held camera straight forward (positive X direction in the front_camera_link
frame):
Overlooking the jitter caused by my hand motion, I would expect the odometry arrows to be directed “into to ground” / co-linear to the
front_camera_frame
’s X axis. Instead, the arrows seem to be directed along the X axis of the base_link
frame i.e. the VO node considers the camera to be position at the robot’s center?
Have I misunderstood the usage of the node’s parameters or am I overlooking something? How can I track the motion of the robot instead of the camera’s? Any help would be greatly appreciate! Thanks in advance.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 1
- Comments: 25 (1 by maintainers)
@tanelikor I take note of your impressions. Thank you very much for your patience and advice 😄
Hi @pimientofrito and @tuch77731 (apologies, I had totally missed your comment).
On our side, it seems like this was fixed at some point in the Humble version since migrating to that a couple months ago fixed the issue for us and we haven’t needed the self-crafted transforming since. I’m not sure why there hasn’t been any reports by the maintainers about that in this issue. I had plans to take some recording of this and post it here, but haven’t found the time to do that thus far.
If you use a version where this has been fixed, then you should likely set the frames to be
If you use a version where this has not been fixed (I do not know which ones those are exactly and it seems really difficult to decipher that from the release / update notes of the package) and wish to use the odom_transformer package that I linked above, then you should probably set both
base_frame
andinput_base_frame
to the value of the left camera frame. This could be “camera_link” or “camera_infra1_frame” etc, depending on which cameras you are using.I hope this helps.
@tanelikor I will test it tomorrow or next week. Thank you very much!
@Parosi Alright, I’ll let you know when the public version of the node is ready.