How to use fake_localization for tf node

asked 2020-09-02 09:29:10 -0500

creazy gravatar image

Hello,

I need to move my PR2-robot to a random target point. I tried using tf transform by creating a node "targetpoint" and then lookupTransform from targetpoint to the base_link but the way I created my targetpoint seems to be depending on the robot's base.

if(node.ok()){
    //Create Targetpoint
    transform.setOrigin( tf::Vector3(6.0, 1.0, 0.0) );
    transform.setRotation( tf::Quaternion(0, 0, 0, 1) );
    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_footprint", "targetpoint"));
}

My tutor now recommended using "fake_localization" but I can't find a tutorial about how to use a fake localization within my code to get the current robot position or to create a node with it. Can anyone please help or recommend any tutorial?

edit retag flag offensive close merge delete