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

hanjuku-joshi's profile - activity

2023-02-22 16:17:53 -0500 received badge  Famous Question (source)
2019-12-08 22:59:05 -0500 received badge  Nice Answer (source)
2019-07-15 12:08:28 -0500 received badge  Famous Question (source)
2019-07-15 12:08:28 -0500 received badge  Notable Question (source)
2019-04-08 01:09:09 -0500 marked best answer how to aggregate several PointCloud2 messages into one?

After converting my RPLIDAR's laser messages to PointCloud2 form (using hector_laser_to_pointcloud) I can visualize them in RVIZ and when doing rostopic echo I can see the messages coming through. How can I assemble the scans so I could get a collective cloud as I move my lidar around? I have my transforms set up and everything, thing is I am not sure as to how I can do this. Is there a package to do this?

2019-04-08 01:06:16 -0500 marked best answer cannot transform laser using laser_assembler

I've successfully used laser_assembler to convert laser scans to pointclouds. However, when viewing the concatenated clouds in rviz they are not de-rotated (projected) accordingly with the fixed frame I've chosen. Pictures:

initially (laser is started): image description

After moving the LiDAR around: image description

Even though octomap progresses correctly in terms of absolute position (x,y,z), it strikes out when it comes to the angles.

Launch file:

<launch>

  <node pkg="laser_assembler" type="laser_scan_assembler" output="screen"  name="laser_scan_assembler">
    <param name="tf_cache_time_secs" type="double" value="10.0" />
    <param name="max_scans" type="int" value="400" />
    <param name="ignore_laser_skew" type="bool" value="true" />
    <param name="fixed_frame" type="string" value="base_link" />
  </node>

  <node pkg="laser_assembler" type="periodic_snapshotter" output="screen"  name="periodic_snapshotter"/>

  <node pkg="IMUEstimate" type="IMUEstimate" name="IMUEstimate" />

  <node pkg="octomap_server" type="octomap_server_node" name="octomap_server">
    <param name="resolution" value="0.05" />
    <param name="latch" value="false" />
    <!--param name="base_frame_id" value="base_link" /-->

    <!-- fixed map frame (set to 'map' if SLAM or localization running!) -->
    <param name="frame_id" type="string" value="map" />

    <!-- maximum range to integrate (speedup!) -->
    <param name="sensor_model/max_range" value="10.0" />

    <!-- data source to integrate (PointCloud2) -->
    <remap from="cloud_in" to="/assembled_cloud2_out" />

  </node>

</launch>

I've tried every possible combination of fixed_frame and frame_id for laser_assembler and octomap respectively, but the result is always the same, either I get a 2D or a 3D octomap that gets rotated by the laser's unprojected frame. I've even pulled in pcl_ros and modified the periodic_snapshotter to transform the resulting pointcloud but no cigar. Here is the code for your review. I tried all combinations possible for the transforms so it's nothing about that (the rest of periodict_snapshotter.cpp is the same):

    // Make the service call
if (client_.call(srv)) {
    tf::StampedTransform localTransform;

    try {
        listener_.lookupTransform("scanmatcher_frame", "map",
                                  ros::Time(0), localTransform);
    }
    catch (tf::TransformException &ex)
    // If the tf listener cannot find the transform, print an error and continue
    {
        ROS_ERROR("Error: %s", ex.what());
    }

    // Transform the point cloud from the map_world frame into the base_footprint frame
    sensor_msgs::convertPointCloudToPointCloud2(srv.response.cloud, initialCloud2);
    pcl_ros::transformPointCloud("map", localTransform, initialCloud2,
                                 transformedCloud2);
    ROS_INFO("Published Cloud with %u points",
             (uint32_t)(srv.response.cloud.points.size()));
    transformedCloud2.header.frame_id = "map";
    pub_.publish(transformedCloud2);
}

Any ideas? I feel like I'm super closed but I just don't know what's going on.

UPDATE, here is my tf tree:

image description

2019-03-01 14:27:27 -0500 received badge  Notable Question (source)
2018-06-26 02:38:13 -0500 marked best answer Problem with data from subscriber not going anywhere

Related question: https://answers.ros.org/question/2781...

In my code there are two subscriber functions. I want to pass the shared pointer data to other data defined in my file. My code is below:

    std::vector<double> imu_, euler_t;
    ros::Publisher escs_pub;

    ros::Subscriber imu_sub;
    ros::Subscriber DOF_sub;
    double I_cm_xx, I_cm_yy, I_cm_zz, P_q, P_w;

    void KeyboardCallback(const maple::Euler_Thrust::ConstPtr& msg){
        euler_t.clear();
        euler_t.resize(4);
        euler_t.push_back((msg->psi)*3.14159265359/180);
        euler_t.push_back((msg->phi)*3.14159265359/180);
        euler_t.push_back((msg->theta)*3.14159265359/180);
        euler_t.push_back(msg->thrust);
    }

    void imuCallback(const sensor_msgs::Imu::ConstPtr &imu) {
        imu_.clear();
        imu_.resize(7);
        imu_.push_back(imu->orientation.x); 
        imu_.push_back(imu->orientation.y); 
        imu_.push_back(imu->orientation.z); 
        imu_.push_back(imu->orientation.w);
        imu_.push_back(imu->angular_velocity.x);
        imu_.push_back(imu->angular_velocity.y);
        imu_.push_back(imu->angular_velocity.z);
    }

    int main(int argc, char **argv){
        ros::init(argc, argv, "P_2");
            ros::NodeHandle nh;
            ros::NodeHandle pnh("~");
            pnh.param("I_cm_xx", I_cm_xx, 0.0118);
            pnh.param("I_cm_yy", I_cm_yy, 0.0118);
            pnh.param("I_cm_zz", I_cm_zz, 0.0181);
            pnh.param("P_q", P_q, 2.27);
            pnh.param("P_w", P_w, 0.85);
        while(ros::ok()){
    ROS_INFO("oy1");
            escs_pub = nh.advertise<maple::ESCs>("ESCs",1);
            DOF_sub = nh.subscribe("KeyboardTeleop", 1, KeyboardCallback);
            imu_sub = nh.subscribe("imu", 1, imuCallback);
            my_pkg::std_msg msg;

            double q_ref_w = cos(euler_t[0]/2)*cos(euler_t[1]/2)*cos(euler_t[2]/2); //THIS IS WHERE THE SEGMENTATION FAULT OCCURS, BECAUSE THE EULER_T VECTOR IS EMPTY OR UNPOPULATED!!!!!!

                  //more math  

            escs_pub.publish(msg);
            ros::spin();
        }

        return 0;
    }

I'm so lost... When excluding any operations with the vectors doing ROS_INFO inside the subscriber functions shows that they do indeed get the data too. I made this code as simple as it can be and it's still not working. I have a feeling it's a problem with the vectors not being passed the values in the right order and I tried that but nothing works. Please, any help would be massively appreciated

2018-04-24 12:22:30 -0500 received badge  Famous Question (source)
2018-01-12 22:53:02 -0500 commented answer cannot transform laser using laser_assembler

Ah, I guess it's just not possible with an integrated IMU. Thank you for sticking out for me, I appreciate it :)

2018-01-12 22:50:47 -0500 received badge  Notable Question (source)
2018-01-12 01:21:47 -0500 commented question cannot transform laser using laser_assembler

I feel like the community could have a use for this , but if you don't know it's ok, I'll probably just try something el

2018-01-12 01:20:45 -0500 commented question cannot transform laser using laser_assembler

Yup, the laser is not moving w.r.t the base_link, and I am moving the robot around. Base_footprint is fixed w.r.t to bas

2018-01-12 00:49:51 -0500 received badge  Popular Question (source)
2018-01-11 21:06:21 -0500 received badge  Famous Question (source)
2018-01-11 12:57:38 -0500 edited question cannot transform laser using laser_assembler

cannot transform laser using laser_assembler I've successfully used laser_assembler to convert laser scans to pointcloud

2018-01-11 12:57:38 -0500 received badge  Editor (source)
2018-01-11 11:43:47 -0500 commented question cannot transform laser using laser_assembler

Yes, I have a static tf publisher from base link to laser. I’ll post the tf tree in a bit so you could take a look for y

2018-01-11 01:28:19 -0500 commented answer How do I get the transformed point cloud from in callback? I'm not getting a rotated cloud in my CB

Hey! Can you share what you have done to transform the PCL correctly? I'm modifying the periodic_snapshotter node from l

2018-01-10 21:43:26 -0500 asked a question cannot transform laser using laser_assembler

cannot transform laser using laser_assembler I've successfully used laser_assembler to convert laser scans to pointcloud

2018-01-08 01:33:26 -0500 received badge  Nice Question (source)
2018-01-08 01:33:22 -0500 received badge  Self-Learner (source)
2018-01-08 01:33:22 -0500 received badge  Teacher (source)
2018-01-07 20:29:29 -0500 answered a question how to aggregate several PointCloud2 messages into one?

I ended up using octomap_server for aggregating the pointcloud messages and used the frame_id as map. I converted laser_

2018-01-07 20:26:02 -0500 commented answer how to aggregate several PointCloud2 messages into one?

Thanks! I already looked at laser assembler but found it easier to use hector_laserscan_to_pointcloud since it generated

2018-01-07 17:12:11 -0500 received badge  Notable Question (source)
2018-01-07 16:13:38 -0500 received badge  Student (source)
2018-01-07 12:36:22 -0500 received badge  Popular Question (source)
2018-01-07 05:27:58 -0500 asked a question how to aggregate several PointCloud2 messages into one?

how to aggregate several PointCloud2 messages into one? After converting my RPLIDAR's laser messages to PointCloud2 form

2018-01-07 05:08:10 -0500 edited question Is my PointCloud2 message broken?

Is my PointCloud2 message broken? Maybe I'm just being a noob in ROS, but after converting my RPLIDAR's laser messages t

2018-01-07 05:02:31 -0500 received badge  Notable Question (source)
2018-01-07 05:02:14 -0500 asked a question Is my PointCloud2 message broken?

Is my PointCloud2 message broken? Maybe I'm just being a noob in ROS, but after converting my RPLIDAR's laser messages t

2017-12-27 11:14:34 -0500 received badge  Popular Question (source)
2017-12-27 11:13:26 -0500 received badge  Popular Question (source)
2017-12-27 08:15:13 -0500 commented answer Problem with data from subscriber not going anywhere

Excellent advice. I actually just ended up solving the problem using arrays instead of vectors, but you certainly have m

2017-12-27 08:13:39 -0500 received badge  Supporter (source)
2017-12-27 04:55:33 -0500 asked a question Problem with data from subscriber not going anywhere

Problem with data from subscriber not going anywhere Related question: https://answers.ros.org/question/278181/issues-wi

2017-12-27 03:19:57 -0500 received badge  Enthusiast
2017-12-26 13:53:20 -0500 commented question Issues with seg-faults and node not publishing anything

There is no error with the code, the node just isn’t publishing or subscribing to anything. I managed to get the topics

2017-12-26 04:47:44 -0500 received badge  Popular Question (source)
2017-12-26 04:09:08 -0500 asked a question Issues with seg-faults and node not publishing anything

Issues with seg-faults and node not publishing anything I hate asking about seg-fault but it's just part of the story. B

2017-09-08 10:39:14 -0500 commented question SSH ROS package on host computer off of USB connection

Yup that's me, but no one answered so I kept trying different methods to make it work. I think I might post in the openc

2017-09-08 05:07:26 -0500 asked a question SSH ROS package on host computer off of USB connection

SSH ROS package on host computer off of USB connection Hey, sorry if I worded the question weirdly. I have a Jetson TK1