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

alex_f224's profile - activity

2019-09-13 02:06:57 -0500 received badge  Self-Learner (source)
2019-09-13 02:06:57 -0500 received badge  Teacher (source)
2018-10-24 13:37:27 -0500 received badge  Notable Question (source)
2018-10-02 13:40:02 -0500 received badge  Famous Question (source)
2018-09-11 16:12:48 -0500 received badge  Popular Question (source)
2018-07-30 09:38:54 -0500 received badge  Notable Question (source)
2018-07-12 00:32:46 -0500 commented question turtlebot installation on ROS melodic

I included these packages: turtlebot3_fake turtlebot3_gazebo turtlebot3_simulations turtlebot3_navigation. I could not

2018-07-12 00:31:53 -0500 commented question turtlebot installation on ROS melodic

I included these packages: turtlebot3_fake turtlebot3_gazebo turtlebot3_simulations. I could not get gmapping to work

2018-07-12 00:30:28 -0500 commented question turtlebot installation on ROS melodic

Also looking for the "correct" answer for this question. But I did setup turtlbot3 for navigation task using this repo:

2018-07-03 12:03:33 -0500 received badge  Famous Question (source)
2018-07-03 08:59:51 -0500 received badge  Famous Question (source)
2018-06-23 12:58:49 -0500 received badge  Enthusiast
2018-06-22 17:57:19 -0500 marked best answer How does AMCL publishes tf using pose?

In my project, I am able to obtain a special pose (a future pose based on prediction) of a robot, and I need to publish the pose as tf from map to odom_future frame (my new frame). I know that amcl has provided such a tf publishing code. Therefore, I try to use the AMCL code to write a publisher that convert a pose and publish tf like amcl. However, I encountered some difficulties.

In the amcl_node.cpp file, it contains the following lines:

    // subtracting base to odom from map to base and send map to odom instead
    geometry_msgs::PoseStamped odom_to_map;
    ...
    tf2::Quaternion q;
    q.setRPY(0, 0, hyps[max_weight_hyp].pf_pose_mean.v[2]);
    tf2::Transform tmp_tf(q, tf2::Vector3(hyps[max_weight_hyp].pf_pose_mean.v[0],
                                          hyps[max_weight_hyp].pf_pose_mean.v[1],
                                          0.0));

    geometry_msgs::PoseStamped tmp_tf_stamped;
    tmp_tf_stamped.header.frame_id = base_frame_id_;
    tmp_tf_stamped.header.stamp = laser_scan->header.stamp;
    tf2::toMsg(tmp_tf.inverse(), tmp_tf_stamped.pose);  //invert the given pose
    this->tf_->transform(tmp_tf_stamped, odom_to_map, odom_frame_id_); ///subtraction occurs here
    ...

I tried to use this snippet to help build my tf broadcaster, but it gives the error:

"Do not call canTransform or lookupTransform with a timeout unless you are using another thread for populating data. Without a dedicated thread it will always timeout.  If you have a seperate thread servicing tf messages, call setUsingDedicatedThread(true) on your Buffer instance.";

My only major modification is the time stamp, because my node does not subscribe a laser scan (I also tried to subscribe a laser scan, and use the timestamp, but it doesn't work as well):

tmp_tf_stamped.header.stamp = ros::Time::now();

I've also tried setUsingDedicatedThread(true). The error disappears, but the node doesn't do anything.

Questions:

  1. What exactly does tf_->transform(...) do? I couldn't find any documentation about this function.
  2. Does the error originated from the timestamp?
  3. Is there any other elegant way to compute the tf between map and odom_future from pose? (in the same way of odom frame).
2018-06-22 12:52:55 -0500 received badge  Supporter (source)
2018-06-22 05:02:20 -0500 received badge  Popular Question (source)
2018-06-21 23:16:18 -0500 edited answer How does AMCL publishes tf using pose?

I figured out it is non-trivial in my application to compute tf(map, odom_future) and tf(odom_future, base_footprint_fut

2018-06-21 23:14:43 -0500 answered a question How does AMCL publishes tf using pose?

I figured out it is non-trivial in my application to compute tf(map, odom_future) and tf(odom_future, base_footprint_fut

2018-06-21 16:18:05 -0500 marked best answer How to use pose for `move_base` to produce `cmd_vel`?

From the Wiki page of move_base, it seems that move_base obtains the pose estimation of a robot by a tf from map to odom, which is often published by amcl. However, in my application, I use a motion predictor to predict the future pose of the robot, and I want to use that future pose as a basis for my move_base computation (i.e. use the future pose instead of the current pose estimated by amcl).

The message of my future pose is geometry_msgs/PoseWithCovarianceStamped, which is not a tf. How do I control the robot using geometry_msgs/PoseWithCovarianceStamped instead of tf for move_base?

There are several solutions that I have tried:

  1. One alternative is to replace the tf publisher in amcl with a custom tf publisher (from map to odom) using the future pose, but it causes the laser scan misaligned.

  2. Another alternative is to keep the original amcl code unchanged, and write a tf publisher (from map to odom_future frame) using the future pose . This approach seems realistic, because it does not affect localization and sensor readings, but I could not find the pieces of code in move_base to expect the frame odom_future instead of odom.

Could somebody provide me some guidance?

2018-06-21 16:18:05 -0500 received badge  Scholar (source)
2018-06-21 16:18:04 -0500 commented answer How to use pose for `move_base` to produce `cmd_vel`?

Hi @mathsci, your suggestion works fine at the end. However, I wonder how to compute the tf from map to odom based on a

2018-06-21 16:16:05 -0500 received badge  Notable Question (source)
2018-06-21 16:14:27 -0500 edited question How does AMCL publishes tf using pose?

How does AMCL publishes tf using pose? In my project, I am able to obtain a special pose (a future pose based on predict

2018-06-21 16:13:10 -0500 edited question How does AMCL publishes tf using pose?

How does AMCL publishes tf using pose? In my project, I am able to obtain a special pose (a future pose based on predict

2018-06-21 16:13:07 -0500 edited question How does AMCL publishes tf using pose?

How does AMCL publishes tf using pose? In my project, I am able to obtain a special pose (a future pose based on predict

2018-06-21 16:12:43 -0500 edited question How does AMCL publishes tf using pose?

How does AMCL publishes tf using pose? In my project, I am able to obtain a special pose (a future pose based on predict

2018-06-21 16:09:32 -0500 asked a question How does AMCL publishes tf using pose?

How does AMCL publishes tf using pose? In my project, I am able to obtain a special pose (a future pose based on predict

2018-06-21 13:51:49 -0500 marked best answer Running two subscribers concurrently in the same node

I am working on a problem and need to use the most recent pose from amcl/future (my self-designed topic) and publish it as a tf between two frames.

I made two subscribers for: amcl_pose/future and clock. The subscriber for amcl_pose/future updates a pose struct inside my code whenever it receives a new pose estimate from amcl; the subscriber for clock ignores the clock message and publish the most recent pose from the structure to tf (basically use it to publish tf in a high rate).

The problem is that the amcl_cb function is never called by ROS. I believe it might be a concurrency issue because the two callbacks share the same data structure. What is the "correct" way to implement this? My code snippet is provided.

*Note: the pose published is not the amcl estimated pose. * *The parent_frame and child_frame are only to simplify the snippet, so it is not related. *

void amcl_cb(const geometry_msgs::PoseWithCovarianceStamped::ConstPtr& p){
    pose.header = p->header;
    pose.pose = p->pose;
}

void clock_cb(const rosgraph_msgs::Clock::ConstPtr& dummy){
    tf::TransformBroadcaster broadcaster;
    broadcaster.sendTransform(
    tf::StampedTransform(
    tf::Transform(
      tf::Quaternion(pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w), 
      tf::Vector3(pose.position.x, pose.position.y, pose.position.z)),
    ros::Time::now(),"parent_frame", "child_frame"));
}

int main(int argc, char** argv){
    ros::init(argc, argv, "robot_tf_publisher");
    ros::NodeHandle n;
    ros::Subscriber amcl_sub = n.subscribe<geometry_msgs::PoseWithCovarianceStamped>("amcl_pose/future",1000, amcl_cb);
    ros::Subscriber clock_sub = n.subscribe<rosgraph_msgs::Clock>("clock",1000, clock_cb);
    ros::spin();
}
2018-06-21 12:48:02 -0500 answered a question Running two subscribers concurrently in the same node

Problem solved. Just to let everyone know. Firstly, there is no "bug" in the code; it is just that amcl does not publi

2018-06-21 04:37:09 -0500 received badge  Notable Question (source)
2018-06-21 02:52:51 -0500 received badge  Popular Question (source)
2018-06-21 01:30:11 -0500 edited question Running two subscribers concurrently in the same node

Running two subscribers concurrently in the same node I am working on a problem and need to use the most recent pose fro

2018-06-21 01:29:54 -0500 commented question Running two subscribers concurrently in the same node

The parent_frame and child_frame are only to simplify the snippet, so it is not related.

2018-06-21 01:28:50 -0500 commented question Running two subscribers concurrently in the same node

Thanks for asking. No, it is not the amcl pose. In fact, I used the amcl_pose to make some prediction, which publishes a

2018-06-21 01:27:48 -0500 edited question Running two subscribers concurrently in the same node

Running two subscribers concurrently in the same node I am working on a problem and need to use the most recent pose fro

2018-06-21 01:25:51 -0500 edited question Running two subscribers concurrently in the same node

Running two subscribers concurrently in the same node I am working on a problem and need to use the most recent pose fro

2018-06-21 00:21:51 -0500 asked a question Running two subscribers concurrently in the same node

Running two subscribers concurrently in the same node I am working on a problem and need to use the most recent pose fro

2018-06-20 04:56:02 -0500 received badge  Popular Question (source)
2018-06-19 23:48:45 -0500 received badge  Student (source)
2018-06-19 16:58:13 -0500 edited question How to use pose for `move_base` to produce `cmd_vel`?

How to use pose for `move_base` to produce `cmd_vel`? From the Wiki page of move_base, it seems that move_base obtains t

2018-06-19 16:52:30 -0500 edited question How to use pose for `move_base` to produce `cmd_vel`?

How to use pose for `move_base` to produce `cmd_vel`? From the Wiki page of move_base, it seems that move_base obtains t

2018-06-19 16:45:47 -0500 edited question How to use pose for `move_base` to produce `cmd_vel`?

How to use pose for `move_base` to produce `cmd_vel`? From the Wiki page of move_base, it seems that move_base obtains t

2018-06-19 16:44:42 -0500 edited question How to use pose for `move_base` to produce `cmd_vel`?

How to use pose for `move_base` to produce `cmd_vel`? From the Wiki page of move_base, it seems that move_base obtains t

2018-06-19 16:44:42 -0500 received badge  Editor (source)
2018-06-19 16:44:30 -0500 edited question How to use pose for `move_base` to produce `cmd_vel`?

How to use pose for `move_base` to produce `cmd_vel`? From the Wiki page of move_base, it seems that move_base obtains t

2018-06-19 16:43:02 -0500 asked a question How to use pose for `move_base` to produce `cmd_vel`?

How to use pose for `move_base` to produce `cmd_vel`? From the Wiki page of move_base, it seems that move_base obtains t

2018-06-18 13:57:48 -0500 asked a question Avoid loops when using `geometry_msgs/PoseArray.msg`

Avoid loops when using `geometry_msgs/PoseArray.msg` I am working on motion prediction based on a particle cloud from AM

2018-06-18 13:01:04 -0500 received badge  Organizer (source)