Git Product home page Git Product logo

littleslam_ros2's Introduction

littleslam_ros2

dashing

LittleSLAM ROS2 wrapper.

Install

cd ~/ros2_ws/src
git clone --recursive https://github.com/rsasaki0109/littleslam_ros2
cd ~/ros2_ws/
colcon build  

Run

ros2 run littleslam_ros2 littleslam_ros2  

IO

sub

  • sensor_msgs::msg::LaserScan ("scan")
  • odom (tf2 "base_link"->"odom")(optional,with use_odom:=true)

pub

  • sensor_msgs::msg::PointCloud2 ("icp_map")
  • nav_msgs::msg::Path ("path")
  • nav_msgs::msg::PoseStamped ("current_pose")

Demo

data:ros.org Introduction to Working With Laser Scanner Data (using rosbags)

ros2 run littleslam_ros2 littleslam_ros2 /scan:=/base_scan
ros2 bag play Mapping1/
rviz2 -d config/demo.rviz

demo

Reference

Masahiro Tomono,『introduction to SLAM』(in japanese)
LittleSLAM

littleslam_ros2's People

Contributors

rsasaki0109 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

littleslam_ros2's Issues

How to open the ros1 bag file?

Hi Ryohei,
thanks for creating this repo!
I can build the source. However, I can't open the ros1 Mapping1.bag. Running ros2 bag play -s rosbag_v2 Mapping1.bag returns these error msgs:

usage: ros2 bag play [-h] [-s {sqlite3,my_test_plugin,my_read_only_test_plugin,mcap}]
                     [--read-ahead-queue-size READ_AHEAD_QUEUE_SIZE] [-r RATE]
                     [--topics TOPICS [TOPICS ...]] [-e REGEX] [-x EXCLUDE]
                     [--qos-profile-overrides-path QOS_PROFILE_OVERRIDES_PATH] [-l]
                     [--remap REMAP [REMAP ...]] [--storage-config-file STORAGE_CONFIG_FILE]
                     [--clock [CLOCK] | --clock-topics CLOCK_TOPICS [CLOCK_TOPICS ...] |
                     --clock-topics-all] [-d DELAY] [--playback-duration PLAYBACK_DURATION]
                     [--playback-until-sec PLAYBACK_UNTIL_SEC | --playback-until-nsec PLAYBACK_UNTIL_NSEC]
                     [--disable-keyboard-controls] [-p] [--start-offset START_OFFSET]
                     [--wait-for-all-acked TIMEOUT] [--disable-loan-message]
                     bag_path
ros2 bag play: error: argument -s/--storage: invalid choice: 'rosbag_v2' (choose from 'sqlite3', 'my_test_plugin', 'my_read_only_test_plugin', 'mcap')

It seems incompatiblity of the rosbag2 and rosbag1. My setup uses ros2 rolling environment.

Do you know how to deal with it?

I can't build the code

Starting >>> littleslam_ros2
--- stderr: littleslam_ros2
CMake Error at CMakeLists.txt:18 (find_package):
By not providing "FindPCL.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "PCL", but
CMake did not find one.

Could not find a package configuration file provided by "PCL" (requested
version 1.8) with any of the following names:

PCLConfig.cmake
pcl-config.cmake

Add the installation prefix of "PCL" to CMAKE_PREFIX_PATH or set "PCL_DIR"
to a directory containing one of the above files. If "PCL" provides a
separate development package or SDK, be sure it has been installed.


Failed <<< littleslam_ros2 [ Exited with code 1 ]

Summary: 0 packages finished [15.1s]
1 package failed: littleslam_ros2
1 package had stderr output: littleslam_ros2

thanks for your time.

How to publish odom --> base_link transform?

Hi,
I am using ROS jazzy and Gazebo Harmonic. I have got the package compiled after a few modifications. I am looking to publish the odom --> base_link transform and a nav_msgs/Odometry msg. I can see that it is publishing nav_msgs::msg::Path to the topic /path. So I think my above objectives could be met.

As a first step, I have modified the code in the function broadcast_littleslam as follows.

    odom_transform_.header.frame_id = "odom";
    odom_transform_.child_frame_id = "base_link";
    for(auto pos : map_->poses) {
        geometry_msgs::msg::PoseStamped pose;
        pose.pose.position.x = pos.tx;
        pose.pose.position.y = pos.ty;
        pose.pose.position.z = 0;
        tf2::Quaternion quat_tf;
        quat_tf.setRPY(0.0, 0.0, DEG2RAD(pos.th));
        geometry_msgs::msg::Quaternion quat_msg;
        quat_msg = tf2::toMsg(quat_tf);
        pose.pose.orientation = quat_msg;
        path.poses.push_back(pose);
        if(pos.tx == map_->lastPose.tx &&
                pos.ty == map_->lastPose.ty &&
                pos.th == map_->lastPose.th){
                pose.header.frame_id = "map";
                current_pose_pub_->publish(pose);
            }
        odom_transform_.header.stamp = rclcpp::Time();
        odom_transform_.transform.translation.x = pos.tx;
        odom_transform_.transform.translation.y = pos.ty;
        odom_transform_.transform.translation.z = 0.0;
        odom_transform_.transform.rotation = quat_msg;
    }

    tf_broadcaster_->sendTransform(odom_transform_);
    path_pub_->publish(path);

It is producing unexpected behaviour as in the video attached. (btw, chassis is my base_link). The scan visualizations are gone from RViz and the transforms to left and right wheel are also missing as soon as I run the littleslam_ros2. Any pointers please?

ls.mp4

Nothing showing up on rviz2?

Hello,
I followed the steps but is it not the purpose of this package to be able to make a map with the lidar? After every step it is indeed running without errors but I dont't know what to expect since it doesn't show anything on the rviz2 program when I run it as well .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.