ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

sobot's profile - activity

2023-04-02 08:34:35 -0500 received badge  Nice Question (source)
2020-09-21 01:19:41 -0500 marked best answer How to instruct a robot to cover the whole mapped 2D area?

Hello experts,

I've been searching and trying to figure out how to implement a SLAM based coverage method using ROS on a Turtlebot, that in which the robot builds a map of its workplace and visits every unvisited area of the map (e.g. used floor cleaning applications). You can see what im trying to explain in the following video link:SLAM based cleaning video.

In theory, I know that I have to implement a mapping method (gmapping) to build the map and to Transform robot's Pose to /map and save them or assign a higher cost to the visited areas on the map.

  • I don't know how to instruct or set different dynamically changing goals in the path planner node(s) for the robot to go over unvisited areas in order to give me a complete coverage of the mapped area. (as you could see in the video)

Any ideas or pointing me to the correct direction would be highly appreciated. ps: i'm not a pro programmer but i know my way around it.

EDIT1:

I figured out that one good way to achieve this goal is to use Spanning Tree Coverage (STC) Algorithm, for that one need to export FREE map cell coordinates and build the spanning tree that robot has to navigate through to cover the whole (Unoccupied) area. An explorer node can be used initially to build the map of the environment, but next step would be exporting the FREE Cell coordinates and Spanning Tree (or Greedy) algorithm on the cell coords. STC Paper - any help or guidance in those areas are highly appreciated.

Cheers.

2018-07-21 17:10:51 -0500 marked best answer Occupancy Grid Coordinates

Hi,

This might be a newbie question but i need a help with it or at least to be pointed in the right direction. I need to extract/acquire the (x, y) coordinates of a given map's (grid) cells to be used in a path planning program.

  • like in the RVIZ that you click somewhere on the map and it prints out the coordinates of that specific location. what i need to achieve is to acquire all of available "unoccupied" cells coordinates of a given map for my Node to calculate a STC path for the robot to travel.

How can i achieve this goal through a ROS node?

Does the (x, y) map coordinates system follow a certain rule? for example (0, 0) is always at a specific corner or there is a system for row and column numbering, etc.

Thank you!

2017-03-29 17:38:02 -0500 marked best answer a cheap Laser / IR solution for 2D mapping?

Hi guys,

does anyone know of a relatively cheap sensor solution for 2D mapping? don't need it to be (laser) accurate. just good enough to build a 2D map for some basic indoor navigation job.

Sonar, IR, anything that might do the job.

UPDATE: i also found LiDAR-Lite i guess its fairly new to the marker. it is also very cheap but it should be modified to cover 360 degree around it. anyone tried it before?

Thanks for the ideas n answers.

2016-06-14 22:29:05 -0500 received badge  Necromancer (source)
2016-04-27 14:00:02 -0500 received badge  Teacher (source)
2016-04-27 14:00:02 -0500 received badge  Necromancer (source)
2016-04-13 08:10:37 -0500 received badge  Famous Question (source)
2016-02-09 07:28:39 -0500 answered a question how to change the RPLIDAR frequency?

Hello,

The current Serial Module of the rplidar is not capable of generating PWM signals itself, therefore there is not an option to tweak in the source code, etc. But you need to use an external source to generate and feed the control signal to the device, e.g. an Arduino board, if you wish to modify the LIDAR's frequency.

You can find the devices PIN information in Section 3 of the devkit_manual.

and here you can read about how to work with PWM in Arduino.

Hope it helps.

2016-02-03 15:19:03 -0500 commented answer Code for keeping a list of the "Pose" that Turtlebot has visited.

Lovely! it worked. Thanks So MUCH. may i get a little clarification though? can Hector SLAM replace Gmapping as a slam solution? can it recover from failures like that in PF based slam? slow Gmapping updates and occasional jumps are causing us some problems & am looking for a faster solution.

2016-02-03 13:18:53 -0500 commented question Code for keeping a list of the "Pose" that Turtlebot has visited.

yes. works even better and faster than Gmapping for me.

2016-02-03 13:13:01 -0500 commented answer Code for keeping a list of the "Pose" that Turtlebot has visited.

I just tried a clean install on my machine, also a new install on a VM Hydro with the same config. everything works perfectly movements relative to /map are precise. its just that the Trajectory info is not there, strange. i posted an image of the resulted map in the post.

2016-02-03 04:38:39 -0500 commented answer Code for keeping a list of the "Pose" that Turtlebot has visited.

just did that, no luck with trajectory visualisation. do i need to remove the packages and do a clean install maybe?

2016-02-03 04:01:55 -0500 commented answer Code for keeping a list of the "Pose" that Turtlebot has visited.

updated, launch file is basically a working mix of the ones provided by the hector_slam samples. and no i dont get any errors or anything. I see the /trajectory topic and can add path to RViz but it doesnt visualize lines.

2016-02-02 17:23:33 -0500 commented answer Code for keeping a list of the "Pose" that Turtlebot has visited.

Hello dear Stefan, I tried this at the time you answered me and i could at least visualize the trajectory, today i tried it again with a fresh install of hector_slam and it seems that trajectory_server doesn't work. updated this question already, or should i post a new question? cheers.

2016-02-02 17:20:45 -0500 edited question Code for keeping a list of the "Pose" that Turtlebot has visited.

Hello experts,

i am trying to write a node in cpp that keeps track of the positions that my Turtlebot already traveled to. the reason is that I want my node to compare any given nav goals against the said (visited) pose list and accepts the given nav goal if it is not already in the list. - what im trying to achieve here is a 2D full coverage method. (got to be a challenge to me!!!)

im using a kobuki base, hokuyo lidar, gmapping to build a map in ros indigo.

According to tutorials i came up with the code to retrieve the robot's pose in the /map frame, now i wanna save it and as im new to cpp programming, can anyone can help me with the piece of code that i need to add to my node in order to make it happen?

a piece of the Code where pose is looked up:

tf::StampedTransform transform;
        try{
            ros::Time now=ros::Time::now();
            listener.waitForTransform("/map","/base_link",now,ros::Duration(3.0));
            listener.lookupTransform("/map","/base_link",ros::Time(0), transform);
            ROS_INFO("Got a transform! x = %f, y = %f",transform.getOrigin().x(),transform.getOrigin().y()); //to check results
        }
        catch (tf::TransformException ex){

            ROS_ERROR("%s" ,ex.what());
       }

UPDATE:

Today I made a fresh installed of hector_slam on my Indigo to work with trajectory_server, everything works perfect with hector_mapping as i get a consistent map, good pose updates, etc. But the hector_trajectory_server doesnt seem to work. i use the same instructions as Stefan gave below in his comment along with hector_mapping.

My tf tree: map > base_link > laser

output of rosservice call trajectory is a series of

  header: 
    seq: 0
    stamp: 
      secs: 1454454715
      nsecs: 262124169
    frame_id: /map
  pose: 
    position: 
      x: 0.0
      y: 0.0
      z: 0.0
    orientation: 
      x: 0.0
      y: 0.0
      z: 0.0
      w: 1.0

UPDATE2 Launch file:

    <launch>
      <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>
      <arg name="base_frame" default="/base_link"/>
      <arg name="odom_frame" default="/base_link"/>
      <arg name="pub_map_odom_transform" default="true"/>
      <arg name="scan_subscriber_queue_size" default="5"/>
      <arg name="scan_topic" default="scan"/>
      <arg name="map_size" default="2048"/>
      <arg name="trajectory_source_frame_name" default="/base_link"/>
      <arg name="trajectory_update_rate" default="4"/>
      <arg name="trajectory_publish_rate" default="0.25"/>
      <arg name="map_file_base_name" default="hector_slam_map"/>
      <arg name="map_file_path" default="$(find test_nav)/maps"/>  

      <node pkg="hector_mapping" type="hector_mapping" name="hector_mapping" output="screen">

        <!-- Frame names -->
        <param name="map_frame" value="/map" />
        <param name="base_frame" value="$(arg base_frame)" />
        <param name="odom_frame" value="$(arg odom_frame)" />

        <!-- Tf use -->
        <param name="use_tf_scan_transformation" value="true"/>
        <param name="use_tf_pose_start_estimate" value="false"/>
        <param name="pub_map_scanmatch_transform" value="false"/>
        <param name="pub_map_odom_transform" value="$(arg pub_map_odom_transform)"/>

        <!-- Map size / start point -->
        <param name="map_resolution" value="0.05"/>
        <param name="map_size" value="$(arg map_size)"/>
        <param name="map_start_x" value="0.5"/>
        <param name="map_start_y" value="0.5" />
        <param name="map_multi_res_levels" value="2" />

        <!-- Map update parameters -->
        <param name="update_factor_free" value="0.4"/>
        <param name="update_factor_occupied" value="0.9" />    
        <param name="map_update_distance_thresh" value="0.4"/>
        <param name="map_update_angle_thresh" value="0.06" />
        <param name="laser_z_min_value" value = "-1.0" />
        <param name="laser_z_max_value" value = "1.0 ...
(more)
2015-11-12 23:47:08 -0500 received badge  Taxonomist
2015-10-22 05:12:20 -0500 marked best answer Costmap layers

Hello,

is there a way to insert and remove a costmap2d layer through code (not manually) during an operation?

I want to insert a virtual confinement (i thought its best to do it with map Layers) for my turtlebot and then remove it after a certain condition has been met.

UPDATE: does anyone know of the "Parameter" that can enable/disable a Costmap layer during run time?

Thank you guys :)

2015-10-07 07:38:32 -0500 received badge  Famous Question (source)
2015-09-25 18:26:13 -0500 received badge  Popular Question (source)
2015-09-25 08:51:56 -0500 asked a question issue with SLAM gmapping rotating the map

Hello,

As you know, when building a map with Gmapping it rotates or transforms the map some degrees. Therefor if I program (preset) markers or a boundary polygon so that it applies to the map thats created through slam gmapping at some stage of the robot's operation -- in order to define an area of interest for the robot etc -- it may not (does not) align with the Map to give me the intended result.

For example, if i want to define a 2x2 meter area through a pre-configured boundary on the map, my polygon boundary always have zero rotation and matches the base grid in RVIZ (perpendicular to the bottom of the screen) but the Map could have different rotations and they can't be laid over each other like I intended to. The polygon crosses over the walls or sits on the wrong places due to the map's rotation, etc.

Is there a way to somehow correct the rotation of the map (during or after map building) so it aligns better with my polygon? Is there a replacement method to build maps which could help fix this issue that i have and give me a none rotated map?

I already read the other "old" question that there is regarding the rotation issue - didnt help.

Thank you for your help and advices.

2015-09-22 10:50:44 -0500 commented answer Automatic multi-session mapping for RTABMap.

@Tanmay Hi, can i bother you to ask what stereo camera pair are you using for this project? i'm looking to choosing one with a reasonably cheap price tag (for indoor applications) at the moment, or even a guide to building a DIY one. Thank you!

2015-08-24 16:07:32 -0500 commented question problem with frontier_exploration pkg

@RS Unfortunately i was not able to do that.

2015-07-22 14:17:48 -0500 received badge  Famous Question (source)
2015-06-28 13:53:36 -0500 received badge  Notable Question (source)
2015-06-27 15:22:15 -0500 received badge  Popular Question (source)
2015-06-27 12:07:13 -0500 commented question running several nodes automatically and as per need

Thank you @gvdhoorn i just googled HSM + ROS and came up with SMACH. just to be clear is that the kind of approach that you are suggesting for this job?

2015-06-27 08:03:17 -0500 asked a question running several nodes automatically and as per need

Hello,

I am looking to figure out how to setup an Automatic Launch method for a project in ROS involving several nodes in different packages. Idea is that those nodes need to be executed at different times, as per need or pause and re-run if a certain condition arose.

I can be wrong but as far as i know with a Launch file you can start the the nodes at one time or - somewhere in this website i read - nodes could be launched conditionally through the launch file.

What i am looking to figure out is how to go about to achieve the following type of automatic Execution of nodes:

Run the initial node (node A) from a package and then when there is the right time (depending on; a condition is met or an interesting information is received or a job is done by another node) Node B starts and deals with its own assignment and sleeps again waiting to be called again or not. project could have more nodes and different orders of executions.

Lets say there is a Patrol Robot that starts its job, then when it receives an alarm or detects an abnormality in the area it enters a Sweep mode (node from another package) to thoroughly explore that certain part of the perimeter and when it clears the area, robot pause or stops the Sweeping and goes back to normal Patrolling mode unless there is another alarm, etc. (Something like this or more complex in terms of number of nodes)

Would be nice if you could either explain the way to go about it or link resources for me read.

2015-06-21 03:17:01 -0500 marked best answer autonomously localise robot at "starting" point

Hello,

I need a little clarification for the localisation methods for the following purpose:

  • I want to autonomously localise my Turtlebot at the starting point (which could be anywhere in a room) then send some navigation goals for it to follow, then at the end i want my turtlebot to return to the same initial point which it had localised itself in the beginning, all without any user intervention.

my setup is a Turtlebot, Hokuyo Lidar, ROS indigo and without initial map (i'd want to create the map on the fly). as i am still learning ROS, im wondering what components can provide a solution for this task in order to localise the robot in the start and save the pose for later use?

UPDATE: with which functions i could set and retrieve the initial pose?

Thanks a lot for the inputs.

2015-06-17 09:29:57 -0500 commented answer Use data from IR sensor to build a costmap

Thank you!

2015-06-16 13:22:26 -0500 received badge  Famous Question (source)