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

pgarcia's profile - activity

2021-05-29 04:18:16 -0500 received badge  Famous Question (source)
2020-12-09 00:33:31 -0500 received badge  Popular Question (source)
2020-08-31 05:33:03 -0500 asked a question global_planner eventually creates paths over obstacles when calling /GlobalPlanner/make_plan

global_planner eventually creates paths over obstacles when calling /GlobalPlanner/make_plan Hi all! I'm using Gmapping

2020-07-08 20:13:37 -0500 received badge  Famous Question (source)
2020-06-04 14:28:15 -0500 received badge  Notable Question (source)
2020-06-04 03:23:39 -0500 commented answer hector_slam/gmapping with T265 (odometry) and RPLidar

apparently, it does ;)

2020-06-04 02:51:19 -0500 received badge  Supporter (source)
2020-06-04 02:51:18 -0500 marked best answer hector_slam/gmapping with T265 (odometry) and RPLidar

Hello everybody

I am trying to make SLAM using a 2D laser scanner (RPLidar A1) supporting it with a Realsense camera T265, which provides an accurate odometry.

The arrangement of both devices is as follows:

image description

The realsense ROS package provides two main frames: camera_odom_frame and camera_pose_frame. This last one is the one that moves around when the camera moves through the space. This is the tf tree created by the camera package:

image description

I have tried to use these two devices with two SLAM packages: hector_slam and gmapping.

hector_slam

This package works well when carrying out SLAM without odometry. My problem comes when I try to include the odometry information. After launching the LIDAR and the camera packages, I launch hector_slam using the following launch file:

<?xml version="1.0"?>
  <launch>
  <arg name="tf_map_scanmatch_transform_frame_name" default="scanmatcher_frame"/>

  <!-- <arg name="base_frame" default="base_footprint"/> -->
  <arg name="base_frame" default="base_link"/>

  <!-- <arg name="odom_frame" default="nav"/> -->
  <arg name="odom_frame" default="camera_odom_frame"/>

  <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"/>

  <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_odom_transform" value="$(arg pub_map_odom_transform)"/>

    <!-- Map size / start point -->
    <param name="map_resolution" value="0.050"/>
    <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" />

    <!-- Advertising config --> 
    <param name="advertise_map_service" value="true"/>

    <param name="scan_subscriber_queue_size" value="$(arg scan_subscriber_queue_size)"/>
    <param name="scan_topic" value="$(arg scan_topic)"/>

    <!-- Debug parameters -->
    <!--
      <param name="output_timing" value="false"/>
      <param name="pub_drawings" value="true"/>
      <param name="pub_debug_output" value="true"/>
    -->
    <param name="tf_map_scanmatch_transform_frame_name" value="$(arg tf_map_scanmatch_transform_frame_name)" />
  </node>

   <node pkg="tf" type="static_transform_publisher" name="map_to_camera_odom_broadcaster" args="0 0 0 0 0 0 map camera_odom_frame 100"/>
   <node pkg="tf" type="static_transform_publisher" name="base_to_camera_broadcaster" args="0 0.05 -0.10 3.1415/2 0 0 base_link camera_pose_frame 100"/>
   <node pkg="tf" type="static_transform_publisher" name="base_to_laser_broadcaster" args="0 0 0 0 0 0 base_link laser 100"/>
</launch>

Note the tf nodes launched at the end of the file. This launcher throws this error:

[ERROR] [1591184110.747014370]: Transform failed during publishing of map_odom transform: Could not find a connection between 'camera_odom_frame' and 'base_link' because they are not part of the same tree.Tf has two or more ...
(more)
2020-06-04 02:51:18 -0500 received badge  Scholar (source)
2020-06-04 02:50:55 -0500 answered a question hector_slam/gmapping with T265 (odometry) and RPLidar

Thank you very much for the answer. As you suggest, replacing base_link by camera_pose_frame makes it work. Additional

2020-06-04 02:50:55 -0500 received badge  Rapid Responder (source)
2020-06-03 13:42:46 -0500 received badge  Popular Question (source)
2020-06-03 11:32:41 -0500 commented question hector_slam/gmapping with T265 (odometry) and RPLidar

Great, thanks!

2020-06-03 11:32:21 -0500 edited question hector_slam/gmapping with T265 (odometry) and RPLidar

hector_slam/gmapping with T265 (odometry) and RPLidar Hello everybody I am trying to make SLAM using a 2D laser scanner

2020-06-03 11:02:49 -0500 received badge  Student (source)
2020-06-03 08:03:32 -0500 asked a question hector_slam/gmapping with T265 (odometry) and RPLidar

hector_slam/gmapping with T265 (odometry) and RPLidar Hello everybody I am trying to make SLAM using a 2D laser scanner

2020-01-13 14:13:53 -0500 received badge  Notable Question (source)
2020-01-13 14:13:53 -0500 received badge  Popular Question (source)
2019-10-19 08:34:03 -0500 asked a question bebop_autonomy on Raspberry Pi 3 (Raspian-stretch), parrot_arsdk won't compile

bebop_autonomy on Raspberry Pi 3 (Raspian-stretch), parrot_arsdk won't compile Hello there! I'm trying to run bebop_aut

2019-10-19 08:26:54 -0500 asked a question bebop_autonomy with from-source-compiled parrot_arsdk in Raspberry Pi 3

bebop_autonomy with from-source-compiled parrot_arsdk in Raspberry Pi 3 Hello there! I'm trying to run bebop_autonomy o

2017-01-18 09:54:38 -0500 received badge  Famous Question (source)
2016-05-16 16:54:44 -0500 received badge  Notable Question (source)
2016-05-07 02:40:52 -0500 received badge  Enthusiast
2016-05-03 10:15:45 -0500 received badge  Notable Question (source)
2016-05-03 06:52:10 -0500 answered a question Class member with subscriptor does not update

Hello Ahendrix

Thank you very much for your answer. The code above actually works. The problem was in another part of the code: the topic /topic_B was not actually being published continuously. That is why B_member.x was not updated.

2016-04-30 10:20:20 -0500 received badge  Popular Question (source)
2016-04-29 12:28:16 -0500 asked a question Class member with subscriptor does not update

Hi everybody!

I'm having some problems with a simple program. There is a main class A, which uses a second class B. Both of them are subscribed to different topics. I simplified both of them:

class B {
   private:
      ros::NodeHandle n;
      ros::Subscriber sub;
   public:
      float x;

      void callBack_B(const type_1 msg){
        x=msg.data
      }

      B() {
        sub=n.subscribe("/topic_B", 1, &B::callBack_B, this);
        x=0;
      }
};

class A {
   private:
      ros::NodeHandle n;
      ros::Subscriber sub;
      ros::Publisher pub;
   public:
      float y;
      type_2 z;
      B B_member;

      void main_process_A(const type_3 msg){
        y = msg.data
        z.data = B_member.x + y;
        pub.publish(z);
      }

      A() {
        sub=n.subscribe("/topic_A", 1, &A::main_process_A, this);
        y=0;
      }
};

int main(int argc, char **argv)
{

  ros::init(argc, argv, "my_node");

  A A_member;
  ros::spin();

  return 0;
}

I hope I did not make any mistakes in this code; anyway my code is similar and compiles without any problem.

The thing is that B_member.x does not update! Its value is always the same! What am I doing wrong? I know one solution would be to merge A and B in the same class, but I would like to understand how ROS works...

Thank you very much in advance!!

2016-04-19 11:46:05 -0500 received badge  Popular Question (source)
2016-04-19 09:44:23 -0500 answered a question ROS_MASTER_URI not taken, ubuntu hostname taken instead

Ok, I fixed it!

I was executing the publisher in the Raspberry as super user (because one of the libraries I use needs it). Then, editing the .bashrc under super user, fixed the problem.

2016-04-19 09:34:41 -0500 commented question ROS_MASTER_URI not taken, ubuntu hostname taken instead

Thanks for your comment! Yes, I added them to both .bashrc.

To be sure, I also run echo $ROS_HOSTNAME, and both were right (raspberrypi1 and pablo).

2016-04-19 06:53:41 -0500 asked a question ROS_MASTER_URI not taken, ubuntu hostname taken instead

Hi everybody,

I'm running ROS in two machines, in my laptop and in a Raspberry Pi. I'm connecting them through an Ethernet cable. I configured the hostnames in both of them (/etc/hosts):

Laptop:

127.0.0.1       localhost
127.0.1.1       pablo-Aspire-V5-573G
10.42.0.1       pablo
10.42.0.97     raspberrypi1

Raspberry pi:

127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
fe00::0         ip6-localnet
ff00::0         ip6-mcastprefix
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters

10.42.0.97      raspberrypi1
10.42.0.1       pablo

With this configuration, I can ping between them without problem, i.e. ping raspberrypi1 at my laptop, and ping pablo at the Raspberry Pi. Also, I use:

At my laptop:

export ROS_HOSTNAME=pablo
export ROS_MASTER_URI=http://pablo:11311

At the Raspberry Pi:

export ROS_HOSTNAME=raspberrypi1
export ROS_MASTER_URI=http://pablo:11311

So I want my laptop to be the master, and the Raspberry to be the slave and send messages to my laptop.

Well I ran roscore at my laptop, and I see:

pablo@pablo-Aspire-V5-573G:~$ roscore
... logging to /home/pablo/.ros/log/fc0545e6-0620-11e6-8814-78843c3472e1/roslaunch-pablo-Aspire-V5-573G-6959.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://pablo-Aspire-V5-573G:54165/
ros_comm version 1.11.16


SUMMARY
========

PARAMETERS
 * /rosdistro: jade
 * /rosversion: 1.11.16

NODES

auto-starting new master
process[master]: started with pid [6971]
ROS_MASTER_URI=http://pablo-Aspire-V5-573G:11311/

setting /run_id to fc0545e6-0620-11e6-8814-78843c3472e1
process[rosout-1]: started with pid [6984]
started core service [/rosout]

It's taking ROS_MASTER_URI=http://pablo-Aspire-V5-573G:11311/ , but not ROS_MASTER_URI=http://pablo:11311/ as I was expecting! Actually pablo-Aspire-V5-573G is the hostname of my computer in Ubuntu, and ROS takes this one, instead of the one a gave him (pablo). When I run a publisher at the Raspberry Pi, I get:

Unable to register with master node [http://localhost:11311]: master may not be running yet. Will keep trying.

I could fix it just changing everywhere pablo by pablo-Aspire-V5-573G, but still I wonder why it is not working.

Any ideas?