Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No map topic and visualization #103

Open
ShameerMasroor opened this issue Dec 4, 2024 · 0 comments
Open

No map topic and visualization #103

ShameerMasroor opened this issue Dec 4, 2024 · 0 comments

Comments

@ShameerMasroor
Copy link

Hello!

I am trying to integrate your work with a project that I am working on.

My project involves using a drone affixed with a 3D Lidar to map a forest and localize itself.

My drone publishes the following topics, the relevant ones are /scan and /imu/out, and the namespace is simple_drone.
image

/scan is published as a topic with a message type of PointCloud2, and the IMU topic is of type Imu.

I tried to remap the parameters in the lidar_slam.launch.py file to the ones for my drone, as shown in the following code:

import os

import launch
import launch_ros.actions

from ament_index_python.packages import get_package_share_directory

def generate_launch_description():

main_param_dir = launch.substitutions.LaunchConfiguration(
    'main_param_dir',
    default=os.path.join(
        get_package_share_directory('lidarslam'),
        'param',
        'lidarslam.yaml'))

rviz_param_dir = launch.substitutions.LaunchConfiguration(
    'rviz_param_dir',
    default=os.path.join(
        get_package_share_directory('lidarslam'),
        'rviz',
        'mapping.rviz'))

mapping = launch_ros.actions.Node(
    package='scanmatcher',
    executable='scanmatcher_node',
    parameters=[main_param_dir],
    remappings=[('/input_cloud','/simple_drone/scan')],
    output='screen'
    )

tf = launch_ros.actions.Node(
    package='tf2_ros',
    executable='static_transform_publisher',
    arguments=['0','0','0','0','0','0','1','simple_drone/base_link','simple_drone/laser_frame']
    )


graphbasedslam = launch_ros.actions.Node(
    package='graph_based_slam',
    executable='graph_based_slam_node',
    parameters=[main_param_dir],
    output='screen'
    )

rviz = launch_ros.actions.Node(
    package='rviz2',
    executable='rviz2',
    arguments=['-d', rviz_param_dir]
    )


return launch.LaunchDescription([
    launch.actions.DeclareLaunchArgument(
        'main_param_dir',
        default_value=main_param_dir,
        description='Full path to main parameter file to load'),
    mapping,
    tf,
    graphbasedslam,
    rviz,
        ])`

What I feel that the issue lies in is with the transform frames. Do I need to make a transformation between the map and the base_link of the drone? Apologies as I am a beginner with ROS at the moment.

Terminal output on running the lidarslam launch file
image

Secondly, RVIZ shows absolutely no output. I see that some /map and /modified map is being published, but PointCloud2 is not visualizing it.
image

It seems the map frame is missing

The following shows the point cloud created by the lidar:

image

I am unsure as to what the issue is. Any help would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant