I have a `.bag` which contains recorded messages on topics `/topic1` and `/topic2`. The messages have `/world` as frame. Both of the messages associated with these topics are stamped, i.e. they have a header.
The same `.bag` file also contains recorded messages on the topic `/tf` (of type [`tf2_msgs/TFMessage`](http://docs.ros.org/jade/api/geometry_msgs/html/msg/TransformStamped.html)). These transform messages have the `frame_id` set to `/world` and the `child_frame_id` set to the local frames associated with the IMUs from which the messages are being sent over respectively topic `/topic1` and `/topic2`.
Now, I need the messages sent over the `/topic1` and `/topic2` to be converted to their corresponding local frame (i.e the child frame) from the fixed frame `/world`. Since both the `/tf` messages and the messages of the topics `/topic1` and `/topic2` are stamped, I thought we could do this without much trouble, but I'm not sure since I'm very new to ROS.
I've looked around for various solutions, but I didn't find an exact solution for my problem, maybe because I didn't recognize it as such, given my limited knowledge of ROS, as I said.
I would appreciate a step by step description of the approach and, if you don't want to write a full solution with code, at least point me to the similar examples. Please, do not suggest me to read the tutorials of `/tf`, I've partially done it, and it didn't help much.
↧
Transform timestamped messages recorded in a bag file using tf messages
↧
Planning workflow of product positioning with
Hi,
With some breaks I've been working towards an application for my robot where I want to position holes/locations in a product to a specific point in space. I've been digging around and i'd like to check that what I'm trying to do is possible at all, and I hope somebody can confirm if i'm on the right track and if needed nudge me into the right direction. While I've got multiple questions, these all have a common cause, therefore I hope it's OK to pose them all together.
I've made a 4DOF robot where I will pick up different products and bring the holes in that product to a location where a tool will add a feature to that hole. The product cannot be rotated in it's own plane (around its frame z-axis). I would like to position these holes to a specified location one by one. Preferably with Python.
I've made a the [robot moveit package](https://github.com/luminize/matilda_moveit_config) and [a robot_support package](https://github.com/luminize/matilda_support) Below a simple representation:

After a lot of searching I think I have 2 possible solutions:
- Add a `hole` frame to my `tool0` frame of the end-effector, make that the tip of my kinematics chain and have moveit plan that frame to the specified location.
- I could generate a new tool for each product (with a frame at each hole location) and load them with different launch files, but that would give me a new tool for each new product i want to handle and I'm not sure I want the burden of maintaining all those tools.
One hurdle I encounter at trying to position the end effector (just the robot end effector, no extra frames/product) to a point in space with the ros_commander python api is that I can't get the plan to succeed (I try to follow [the moveit tutorial](http://docs.ros.org/hydro/api/pr2_moveit_tutorials/html/planning/scripts/doc/move_group_python_interface_tutorial.html) example).
[link to gist of plan.py](https://gist.github.com/luminize/795ca34fc93e0e57fc70cfe694ab2ce4)
[link to terminal output](https://gist.github.com/luminize/f3cc5470ce905cdd998bbad428c4982a)
but I get errors telling me the plan isn't solvable.
[ INFO] [1493551548.788745043]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1493551548.859191599]: Planner configuration 'manipulator[RRTkConfigDefault]' will use planner 'geometric::RRT'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1493551548.859571195]: manipulator[RRTkConfigDefault]: Starting planning with 1 states already in datastructure
[ INFO] [1493551558.859673954]: manipulator[RRTkConfigDefault]: Created 114272 states
[ INFO] [1493551558.859745128]: No solution found after 10.000228 seconds
[ INFO] [1493551558.869263246]: Unable to solve the planning problem
[ INFO] [1493551558.987668538]: Planning request received for MoveGroup action. Forwarding to planning pipeline.
[ INFO] [1493551559.063110536]: Planner configuration 'manipulator[RRTkConfigDefault]' will use planner 'geometric::RRT'. Additional configuration parameters will be set when the planner is constructed.
[ INFO] [1493551559.063482002]: manipulator[RRTkConfigDefault]: Starting planning with 1 states already in datastructure
[ INFO] [1493551569.063481304]: manipulator[RRTkConfigDefault]: Created 111517 states
[ INFO] [1493551569.063716649]: No solution found after 10.000282 seconds
[ INFO] [1493551569.081697521]: Unable to solve the planning problem
I guess that's because I cannot get to that position because the robot only has 4 DOF and cannot rotate the part. I've been searchin a lot and I've got a lot pieces of the puzzle, but some final pieces seem missing yet.
planning to a pose consisting of joint values work btw.
pose_1 = [1.9, 0.785, -0.785, -1.57]
group.set_joint_value_target(pose_1)
plan3 = group.plan()
group.go()
moves the robot as expected
My questions in a nutshell:
- Is this 4DOF type of planning of a frame to cartesian coordinates possible at
all?
- If I need to provide the exact
position of the end effector frame (so also
roll/pitch/yaw) for the product ens position, which knowledge/info/examples do I need
to consume to implement that.
- regarding planning with just the
stock robot (no tools on the end
effector) I could add 2 extra DOF to
the tip of the end-effector, with
zero length links. Would that be a
satisfactory setup to get solutions?
- If I were to generate (from CAD) a
new tool for each new product. Is
there a way to switch tools at
run-time instead of in my launch file? Where should I look for
further info regarding that.
- As an alternative, can I change link
lenghts of the loaded URDF at
run-time?
- I know how to add a frame to the
`tool0` frame of my robot, but It
does not seem to be a frame I can use
for planning purposes because while
it is viewable in Rvis (add tf
plugin) it does not show up in the
moveit kinematics chain. Is there a
way to add and remove links from the
kinematics chain? Where do I need to
look
Thanks in advance,
Regards,
Bas
↧
↧
Node to convert tf messages to tf2
Hello,
I know tf is depreciated, and that it has been transfered to tf2. I was wondering if anyone has an idea how to convert tf messages to tf2. Particularly, I am using laser scan matcher that is supposed to be supported only till indigo. The laser scan matcher is based off tf, so it possible to transfer tf to tf2? I am new to this, not sure how to do it.
I have looked at the tutorials for tf2, but I am not sure how to build a node for this. Any suggestions, or guidance is appreciated. Here are the links I have looked through:
Laser Scan Matcher Link: http://wiki.ros.org/laser_scan_matcher
TF2 Conversion: http://wiki.ros.org/tf2/Tutorials
Software: Ubuntu 16.04, Kinetic
Thanks.
↧
the diffrence between tf and tf2
I wrote a node based on tf2, and I copied several lines of code based on tf into my node. Then it went wrong, it goes like this:
In file included from /home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:33:0:
/home/pantiq/robot/src/robot_localization/include/robot_localization/ros_filter.h:273:5: error: ‘TransformListener’ in namespace ‘tf2’ does not name a type
tf2::TransformListener listener;
^
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp: In member function ‘void RobotLocalization::RosFilter::imuCallback(const ConstPtr&, const string&, const RobotLocalization::CallbackData&, const RobotLocalization::CallbackData&, const RobotLocalization::CallbackData&)’:
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:421:1: error: ‘listener’ was not declared in this scope
listener.transformPoint ( FID_CAR, posPtr, carposPtr );
^
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:458:1: error: ‘listener’ was not declared in this scope
listener.transformPoint ( FID_CAR, twistPtr, cartwistPtr );
^
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp: In member function ‘void RobotLocalization::R
-
----------
**strong text**
---------
osFilter::run()’:
/home/pantiq/robot/src/robot_localization/src/ros_filter.cpp:1756:14: error: ‘StampedTransform’ is not a member of ‘tf2’
tf2::StampedTransform(
^
make[2]: *** [robot_localization/CMakeFiles/ros_filter.dir/src/ros_filter.cpp.o] Error 1
make[1]: *** [robot_localization/CMakeFiles/ros_filter.dir/all] Error 2
make: *** [all] Error 2
Invoking "make -j4 -l4" failed
Any tips wuuld be appreciated.
↧
error in rosmake tf_workshop
i try to learning [Handling ROS Tutorial](http://ap.isr.uc.pt/events/iros2012tutorial/) course .
when i run this command i have error :
rosmake tf_workshop
error :
/home/zakizadeh/catkin_ws2/src/tf_workshop/src/fdisplay.cpp: In member function ‘void Transforms::DrawFn(int, char*, geometry_msgs::Vector3Stamped, int)’:
/home/zakizadeh/catkin_ws2/src/tf_workshop/src/fdisplay.cpp:62:9: error: ‘visualization_msgs::Marker’ has no member named ‘set_points_size’
marker.set_points_size(2);
my obj_tracker file :
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define pi 3.14159265
class Ktracker{
public:
Ktracker();
ros::Subscriber trkmarker_sub, pose_sub;
ros::Publisher objectpc_pub;
void trackCallback(const visualization_msgs::Marker&);
void poseCallback(const geometry_msgs::PoseStamped&);
tf::TransformListener listener;
tf::StampedTransform transform;
tf::TransformBroadcaster br;
tf::Quaternion qtf;
private:
sensor_msgs::PointCloud objectpc;
};
Ktracker::Ktracker(){
ros::NodeHandle n;
objectpc_pub=n.advertise("objpc",1000);
}
void Ktracker::trackCallback(const visualization_msgs::Marker &msg){
objectpc.set_points_size(msg.get_points_size());
int i;
for (i=0;i<(int) msg.get_points_size();i++){
objectpc.points[i].x=msg.points[i].x;
objectpc.points[i].y=msg.points[i].y;
objectpc.points[i].z=msg.points[i].z;
}
ros::Time now = ros::Time::now();
transform.setOrigin(tf::Vector3(msg.pose.position.x,msg.pose.position.y,msg.pose.position.z));
tf::quaternionMsgToTF(msg.pose.orientation,qtf);
transform.setRotation(qtf);
br.sendTransform(tf::StampedTransform(transform, msg.header.stamp, "/openni_rgb_frame","/object_frame"));
objectpc.header.frame_id="/object_frame";
try
{
// Enter the correct transformation to track the object
//now=ros::Time::now();
listener.waitForTransform("/object_frame", "/end_effector",msg.header.stamp, ros::Duration(0.2));
listener.lookupTransform("/object_frame", "/end_effector",msg.header.stamp, transform);
listener.transformPointCloud("/end_effector",objectpc,objectpc);
objectpc.header.frame_id="/end_effector";
objectpc_pub.publish(objectpc);
}
catch (tf::TransformException ex)
{
ROS_WARN("TF Exception: %s", ex.what());
}
}
void Ktracker::poseCallback(const geometry_msgs::PoseStamped &msg){
objectpc_pub.publish(objectpc);
}
int main(int argc, char **argv)
{
ros::init(argc, argv, "armtrack");
Ktracker ktracker;
ros::Rate loop_rate(20);
visualization_msgs::Marker bluem;
ros::NodeHandle n;
ktracker.trkmarker_sub=n.subscribe("markers_out", 1000, &Ktracker::trackCallback,&ktracker);
ktracker.pose_sub=n.subscribe("armpose",1000, &Ktracker::poseCallback,&ktracker);
ros::spin();
}
my fdisplay.cpp :
#include
#include
#include
#include
#include
#include
class Transforms{
public:
Transforms();
void f1Callback(const geometry_msgs::WrenchStamped&);
void f2Callback(const geometry_msgs::WrenchStamped&);
void DrawFn(int,char*,geometry_msgs::Vector3Stamped,int);
geometry_msgs::Vector3Stamped f1ft,f2ft;
geometry_msgs::PointStamped f1cl,f2cl;
geometry_msgs::PointStamped start;
ros::NodeHandle node;
tf::TransformListener listener;
ros::Subscriber f1_sub,f2_sub;
ros::Publisher marker_pub;
visualization_msgs::Marker marker;
private:
};
Transforms::Transforms(){
marker_pub = node.advertise("fmarker", 10);
start.point.x=0;
start.point.y=0;
start.point.z=0;
}
void Transforms::DrawFn(int id,char* frame, geometry_msgs::Vector3Stamped vector,int color){
marker.header.frame_id = frame;
marker.header.stamp = ros::Time();
marker.ns = "my_namespace";
marker.id = id;
marker.type = visualization_msgs::Marker::ARROW;
marker.action = visualization_msgs::Marker::ADD;
marker.pose.position.x = 0;
marker.pose.position.y = 0;
marker.pose.position.z = 0;
marker.pose.orientation.x = 0.0;
marker.pose.orientation.y = 0.0;
marker.pose.orientation.z = 0.0;
marker.pose.orientation.w = 1.0;
marker.scale.x = 0.008;
marker.scale.y = 0.02;
marker.scale.z = 0.0;
marker.color.a = 1.0;
marker.color.r = 1.0;
marker.color.g = 0.0;
marker.color.b = 0.0;
marker.set_points_size(2);
marker.points[0].x=(start.point.x)/1000;
marker.points[0].y=(start.point.y)/1000;
marker.points[0].z=(start.point.z)/1000;
marker.points[1].x=start.point.x/1000+vector.vector.x/100;
marker.points[1].y=start.point.y/1000+vector.vector.y/100;
marker.points[1].z=start.point.z/1000+vector.vector.z/100;
marker_pub.publish(marker);
}
void Transforms::f1Callback(const geometry_msgs::WrenchStamped& msg){
f1ft.vector=msg.wrench.force;
}
void Transforms::f2Callback(const geometry_msgs::WrenchStamped& msg){
f2ft.vector=msg.wrench.force;
}
int main(int argc, char** argv){
ros::init(argc, argv, "forcesdisplay");
Transforms Trans;
Trans.f1_sub=Trans.node.subscribe("finger1/nano17ft",1000,&Transforms::f1Callback,&Trans);
Trans.f2_sub=Trans.node.subscribe("finger2/nano17ft",1000,&Transforms::f2Callback,&Trans);
ros::Rate rate(10.0);
ros::Time now;
geometry_msgs::Vector3Stamped wvect,weight,weight1;
tf::Vector3 weight2;
tf::Transformer TransClass;
tf::StampedTransform transform;
tf::Stamped vaux,w2;
while (Trans.node.ok()){
Trans.DrawFn(1,"/BHand/FingerOne/Sensor",Trans.f1ft,1);
Trans.DrawFn(2,"/BHand/FingerTwo/Sensor",Trans.f2ft,1);
//DRAW WEIGHT:
//FINGER 1
tf::vector3StampedMsgToTF(Trans.f1ft,vaux);
try{
now = ros::Time::now();
vaux.frame_id_="/BHand/FingerOne/Sensor";
vaux.stamp_=now;
Trans.listener.waitForTransform("/BHand/FingerOne/Sensor", "/robot_base", now, ros::Duration(3.0));
Trans.listener.lookupTransform("/BHand/FingerOne/Sensor", "/robot_base",now/*ros::Time(0)*/, transform);
Trans.listener.transformVector("/robot_base",vaux,w2);
tf::vector3TFToMsg(w2,wvect.vector);
weight=wvect;
}
catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
}
try{
//FINGER 2
tf::vector3StampedMsgToTF(Trans.f2ft,vaux);
now = ros::Time::now();
vaux.frame_id_="/BHand/FingerTwo/Sensor";
vaux.stamp_=now;
Trans.listener.waitForTransform("/BHand/FingerTwo/Sensor", "/robot_base",now, ros::Duration(3.0));
Trans.listener.lookupTransform("/BHand/FingerTwo/Sensor", "/robot_base",now, transform);
Trans.listener.transformVector("/robot_base",vaux,w2);
tf::vector3TFToMsg(w2,wvect.vector);
weight.vector.x=weight.vector.x+wvect.vector.x;
weight.vector.y=weight.vector.y+wvect.vector.y;
weight.vector.z=weight.vector.z+wvect.vector.z;
Trans.DrawFn(5,"/robot_base",weight,3);
printf("Weight:%f %f %f = %f\n",weight.vector.x,weight.vector.y,weight.vector.z,sqrt(weight.vector.x*weight.vector.x+weight.vector.y*weight.vector.y+weight.vector.z*weight.vector.z));
}
catch (tf::TransformException ex){
ROS_ERROR("%s",ex.what());
}
ros::spinOnce();
rate.sleep();
}
return 0;
};
↧
↧
ROS TF claims tree disconnected, but clearly connected
Hi all
I am playing back some rosbag file.
In RVIZ, I see the error message "No transform from [area_description] to frame [start_of_service]".
TF view_frames agrees and shows the following:

However, when I export the rosbag file, /tf topic only, to .csv format, I can clearly see that there are 3 kinds of transformations in the rosbag file:
1. map -> start_of_service
2. start_of_service -> device
3. area_description -> start_of_service
Whereas the left side is the value in "field.transforms0.header.frame_id", and the right side is the value in "field.transforms0.child_frame_id" in the resulting .csv file.
Now, the resulting graph is acyclic. If we choose start_of_service as root, this is clearly a valid tree.
The question remains:
**Is ROS able to invert the transformations so to form a valid TF tree?**
Apologies if this has been asked before. I was unable to find an answer on google or here.
Cheers!
- ibd
↧
Bug? Rosbag filter and /tf_static
Hi all
I am using a .bag file with RTAB-map ROS. It uses some static transforms between different camera frames to do the mapping.
When I feed "data.bag" into RTAB-map, it works fine.
Now, I create a dummy filtered rosbag, using:
rosbag filter data.bag data_filtered.bag "topic != '/thistopicdoesntexist'"
As this topic doesn't exist, it should create an identical .bag file. However, when I try to feed "data_filtered.bag" into RTAB-map, I get many errors like:
[ WARN] [1494031985.023853640, 1493939596.985478852]: Could not get transform from camera_depth to camera_color after 0.100000 seconds (for stamp=1493939594.615704)! Error=". canTransform returned after 0.10093 timeout was 0.1.".
1. It seems that the filtered bag somehow is missing data from the static TF transforms. When I "rostopic echo -b data_filtered.bag", however, it shows that the static transforms are there.
2. It seems that the dummy filtering actually alters the .bag. Both MD5 hash and file size are changed between "data.bag" and "data_filtered.bag"! No compression is used. Why is that?
Maybe the problem is related to the time stamp? In any case, I am using use_sim_time=true, and I am also using --clock when playing back the .bag files.
Any help would be appreciated.
Cheers,
- ibd
↧
About the tf.Exception
I practice the tf according to [tf_tutorials](http://wiki.ros.org/tf/Tutorials/Time%20travel%20with%20tf%20%28Python%29),but after I changed the codes liske what it said,an error happened and the process was killed.
Traceback (most recent call last):File "/home/bob/bob_catkin_practice/src/learning_tf/nodes/turtle_tf_listener.py", line 33, in
"/world",rospy.Duration(2.0))tf.Exception: Lookup would require extrapolation into the past. Requested time 1494079818.464235067 but the earliest data is at time 1494079823.260601044, when looking up transform from frame [turtle1] to frame [world][listener-6] process has died [pid 16244, exit code 1, cmd /home/bob/bob_catkin_practice/src/learning_tf/nodes/turtle_tf_listener.py __name:=listener __log:=/home/bob/.ros/log/bc22b5f4-3265-11e7-a3a0-000c2998b220/listener-6.log].log file: /home/bob/.ros/log/bc22b5f4-3265-11e7-a3a0-000c2998b220/listener-6*.log
Here is the file:
#!/usr/bin/env python
#coding:utf-8
import roslib
roslib.load_manifest('learning_tf')
import rospy
import math
import tf
import geometry_msgs.msg
import turtlesim.srv
if __name__ == '__main__':
rospy.init_node('tf_turtle')
listener=tf.TransformListener()
rospy.wait_for_service('spawn')
spawner=rospy.ServiceProxy('spawn',turtlesim.srv.Spawn)
spawner(4,2,0,'turtle2')
turtle_vel=rospy.Publisher('turtle2/cmd_vel',geometry_msgs.msg.Twist,queue_size=1)
rate=rospy.Rate(10)
listener.waitForTransform("/turtle2","/turtle1",rospy.Time(),rospy.Duration(4.0))
while not rospy.is_shutdown():
try:
now=rospy.Time.now()
past=now-rospy.Duration(5.0)
listener.waitForTransformFull("/turtle2",now,
"/turtle1",past,
"/world",rospy.Duration(1.0))
#(trans,rot)=listener.lookupTransform('/turtle2','/carrot1',now)
(trans,rot)=listener.lookupTransformFull("/turtle2",now,
"/turtle1",past,
"/world")
except (tf.LookupException,tf.ConnectivityException,tf.ExtrapolationException) :
continue
angular=4*math.atan2(trans[1],trans[0])
linear=0.5*math.sqrt(trans[0]**2+trans[1]**2)
cmd=geometry_msgs.msg.Twist()
cmd.linear.x=linear
cmd.angular.z=angular
turtle_vel.publish(cmd)
rate.sleep()
I am not very clear about the time in tf.
↧
What's the default frequency of tf.Broadcaster?Is it 60HZ?
Can it be changed?
↧
↧
tf for every child frame?
Hey there,
Is there any possibility to kind of "get" all child frames of a specific frame?
I want to make a transformation (simple rotation on 2 axis) to every child frame of a specific frame. Something like a list which i can iterate through would be awesome, but I'm open to other ideas for sure.
Thanks in advance
↧
Could not find a connection between 'map' and 'base_link' with laser.
Hi all, I have a turtlebot, and add a hokuyo UST 10LX, but now with trouble in mapping . below is the sequence:
1. Add lidar module to robot's urdf file.
$ sudo vi urdf/turtlebot_library.urdf.xacro
2. Edit launch to load lidar' driver
$ sudo vi /opt/ros/indigo/share/turtlebot_bringup/launch/minimal.launch
< !– remap from="scan" to="base_scan" ==This is no longer needed / –>< /node>
3. Then try to map.
$ roscore
$ roslaunch turtlebot_bringup minimal.launch
$ roslaunch turtlebot_navigation gmapping_demo.launch
4. But meet error:
Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.
Tf has two or more unconnected trees.
5. troubleshooting like this:
5.1 $ rosrun rqt_tf_tree rqt_tf_tree
sure, /map is seperated, not belong to any part.
5.2 $ rosrun tf tf_echo map base_link
meet the same hints: Could not find a connection between 'map' and 'base_link' ...
5.3 $ rosrun tf tf_echo base_link base_laser_link
Exception thrown:"base_laser_link" passed to lookupTransform argument source_frame does not exist.
6. So I am confused.
I already add a Lidar module to robot urdf module: base_laser_link is child and base_link is parent.
so, since I change the urdf file, I think the ros system will mataintent the tf transform tree automaticly,
but how I can not sucessfuly echo the base_link ---> base_laser_link ,
why this chain failed?
Thank you advanced!!!
↧
Could not find a connection between 'map' and 'base_link' with laser.
Hi all, I have a turtlebot, and add a hokuyo UST 10LX, but now with trouble in mapping . below is the sequence:
1. Add lidar module to robot's urdf file.
$ sudo vi urdf/turtlebot_library.urdf.xacro
2. Edit launch to load lidar' driver
$ sudo vi /opt/ros/indigo/share/turtlebot_bringup/launch/minimal.launch
< !– remap from="scan" to="base_scan" ==This is no longer needed / –>< /node>
3. Then try to map.
$ roscore
$ roslaunch turtlebot_bringup minimal.launch
$ roslaunch turtlebot_navigation gmapping_demo.launch
4. But meet error:
Could not find a connection between 'map' and 'base_link' because they are not part of the same tree.
Tf has two or more unconnected trees.
5. troubleshooting like this:
5.1 $ rosrun rqt_tf_tree rqt_tf_tree
sure, /map is seperated, not belong to any part.
5.2 $ rosrun tf tf_echo map base_link
meet the same hints: Could not find a connection between 'map' and 'base_link' ...
5.3 $ rosrun tf tf_echo base_link base_laser_link
Exception thrown:"base_laser_link" passed to lookupTransform argument source_frame does not exist.
6. So I am confused.
I already add a Lidar module to robot urdf module: base_laser_link is child and base_link is parent.
so, since I change the urdf file, I think the ros system will mataintent the tf transform tree automaticly,
but how I can not sucessfuly echo the base_link ---> base_laser_link ,
why this chain failed?
Thank you advanced!!!
↧
Launching multiple turtlebots under namespaces (real environment)
I am trying to launch multiple turtlebots (each under a namespace) with navigation stack. I am building upon the similar task for stage simulator [(link)](https://github.com/gergia/multiple_turtlebots_stage_amcl). As a first step, I try to launch a single turtlebot under namespace.
Currently, the attempt to launch a single robot under namespace with amcl failed. The tf tree looks like [this](https://dl.dropboxusercontent.com/u/11955498/framesTurtlebotUnderNamespace.pdf). The link between */map* and *robot\_0/odom* is missing. Amcl should be publishing this connection.
The messages from console are following:
* */robot\_0/amcl: No laser scan received (and thus no pose updates have been published) for 1462444802.174762 seconds. Verify that data is being published on the /robot\_0/scan topic.* : checked, data is being published at /robot\_0/scan
* */robot\_0/amcl: MessageFilter [target=robot\_0/odom ]: Dropped 100.00% of messages so far. Please turn the [ros.amcl.message\_notifier] rosconsole logger to DEBUG for more information.* : **This might be the key message**. If I set the logger level to debug, I see something like *Added message in frame /camera\_depth\_frame at time 1462446392.094, count now 100*.
I guess the trouble is that it is using frame id /camer_depth_frame (the absolute one) instead of one relative to the namespace (_robot\_0 in this case_). I don't know how to fix it. I tried with using *openni2\_tf\_prefix.launch*, but doesn't help.
* */robot\_0/move\_base\_node: Timed out waiting for transform from robot\_0/base\_link to map to become available before running costmap, tf error: . canTransform returned after 0.101826 timeout was 0.1* : I guess this one is just a consequence of previous ones. As I see this question being asked around, but without a complete solution, I created a [git repository](https://github.com/gergia/multiple_turtlebots_real_world) with the current code. I hope once I manage to solve this problem - with your help - to have the complete solution in the repository for the others to have use of it afterwards as well. Feel free to answer here, or experiment directly in the code (and let us know about any successful or even unsuccessful trials).
The messages from console are following:
* */robot\_0/amcl: No laser scan received (and thus no pose updates have been published) for 1462444802.174762 seconds. Verify that data is being published on the /robot\_0/scan topic.* : checked, data is being published at /robot\_0/scan
* */robot\_0/amcl: MessageFilter [target=robot\_0/odom ]: Dropped 100.00% of messages so far. Please turn the [ros.amcl.message\_notifier] rosconsole logger to DEBUG for more information.* : **This might be the key message**. If I set the logger level to debug, I see something like *Added message in frame /camera\_depth\_frame at time 1462446392.094, count now 100*.
I guess the trouble is that it is using frame id /camer_depth_frame (the absolute one) instead of one relative to the namespace (_robot\_0 in this case_). I don't know how to fix it. I tried with using *openni2\_tf\_prefix.launch*, but doesn't help.
* */robot\_0/move\_base\_node: Timed out waiting for transform from robot\_0/base\_link to map to become available before running costmap, tf error: . canTransform returned after 0.101826 timeout was 0.1* : I guess this one is just a consequence of previous ones. As I see this question being asked around, but without a complete solution, I created a [git repository](https://github.com/gergia/multiple_turtlebots_real_world) with the current code. I hope once I manage to solve this problem - with your help - to have the complete solution in the repository for the others to have use of it afterwards as well. Feel free to answer here, or experiment directly in the code (and let us know about any successful or even unsuccessful trials).
↧
↧
Transform different to its own inverse
When configuring `robot_localization` today I came across a weird phenomenon which is, I think, an error. I'm using `navsat_transform_node` to take in our GPS data, and I have the `broadcast_utm_transform` parameter set to `true`. When using `tf_monitor` to view the transforms `utm -> map` and `map -> utm`, they actually differ in translational value, and one is not the negative of the other. [See here](http://imgur.com/a/5QswT) for the result of `tf_monitor`. The time says '0.000', meaning it is a static transform, so it doesn't seem like it can be multiple publishers.
**robot_localization.launch**
[-27.454919, 153.029867, 0.0] [false, false, false,
false, false, false,
true, true, true,
false, false, true,
false, false, false] [false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true,] [false, false, false,
false, false, false,
true, true, true,
false, false, true,
false, false, false] [true, true, false,
false, false, false,
false, false, false,
false, false, false,
false, false, false] [false, false, false,
true, true, true,
false, false, false,
true, true, true,
true, true, true,]
↧
No tf function for applying transformations?
I'm seeing this design strategy in the online course I'm doing:
translation = tf.transformations.translation_from_matrix(T)
rotation = tf.transformations.quaternion_from_matrix(T)
t.transform.translation.x = translation[0]
t.transform.translation.y = translation[1]
t.transform.translation.z = translation[2]
t.transform.rotation.x = rotation[0]
t.transform.rotation.y = rotation[1]
t.transform.rotation.z = rotation[2]
t.transform.rotation.w = rotation[3]
Is there a function for doing something like:
t.apply_translation(translation)
t.apply_rotation(rotation)
or
t.apply_transformation(translation=translation, rotation=rotation)
I think it would make for more readable code, and be faster to write. If there is a function like that, what is it? If not, why not?
Thanks!
TT
↧
tf interpolation
Hello,
I have a question about tf interpolation. if I understand it correctly, tf will interpolate when it is asked for a transform between two published transform values. So If I published tf1 for time 5 and tf2 for time 10 and then ask for transform for time 7, I am going to be returned a transform that is somewhere in between tf2 and tf3.
Question: can I ask tf not to interpolate if the requested timestamp is too far away from a known transform? For example in my example above, can I ask tf to interpolate only if I am within 1s from a given transform. So for example above if I ask for transform at time 7 I don't get anything but if I ask for a transform at time 5.5 or 4.5 I do get it?
Or is there a way to find out what two transforms (along with their timestamps) the interpolation was made?
↧
Transform human pose from camera_frame to Odom frame
I am using face_detector to detect human. I work quite well I can detect human and visualize on Rviz.
However, I would like to know that is it possible to transform detected human position from camera_frame to odom frame?
I am using pepper. Its frame view is
odom >> base_link >> torso >> neck >> head >> CameraTop_frame >> CameraTop_optical_frame
Can I use ` ` to transfrom pose data to odom ? or any idea?
Thank you.
↧
↧
why tf_monitor shows unknown_publisher
When I tf_monitor my frames, I saw all my frames were published by unknown_publisher. Could anyone please give me an idea how that usually happens, and how to solve it?
Also, I wonder whether it has anything to do with my strangely behaved AMCL, which seems to update the robot location only by /odom, and did not care about the laser scan (because laser scan does not align to the map). Thank you.
RESULTS: for all Frames
Frames:
Frame: base_link published by unknown_publisher Average Delay: 0.0187717 Max Delay: 0.0346738
Frame: left_back_wheel published by unknown_publisher Average Delay: 0.0250101 Max Delay: 0.0499581
Frame: left_front_wheel published by unknown_publisher Average Delay: 0.0250121 Max Delay: 0.0499596
Frame: odom published by unknown_publisher Average Delay: 0.0589457 Max Delay: 0.109153
Frame: right_back_wheel published by unknown_publisher Average Delay: 0.0250131 Max Delay: 0.0499602
Frame: right_front_wheel published by unknown_publisher Average Delay: 0.0250138 Max Delay: 0.0499608
Frame: rplidar published by unknown_publisher Average Delay: -0.499657 Max Delay: 0
All Broadcasters:
Node: unknown_publisher 86.3553 Hz, Average Delay: -0.278273 Max Delay: 0.109153
↧
Tf problem LookupTransform not working
Hello,
My question is what is the equivalent code in c++ for the command "rosrun tf tf_echo ". I already tried to use "listener.lookupTransform("/femur_6", "/coxa_6", ros::Time(0), transform);" but it always give me an error of the type " passed to lookupTransform argument target_frame does not exist." But it exists, if I run rosrun tf tf_echo .. it gives me the correct answer.
Thanks
↧
TF problem with google cartographer
Hello,
I'm working on map generation with different tools and I currently struggle with google cartographer for ROS. Only the first scan of the map appears on rviz and when I check my TF frames, the robot frames (laser, base_link, etc) stay at the same position while my odom frame is "moving" backward w.r.t. the robot movement in the simulator.
It actually works fine with gmapping so I don't know what goes wrong here.
Here are my launch and config file for cartographer
https://drive.google.com/open?id=0B1cH0l8kxYjZU1ZqNFJYRV9FT28
https://drive.google.com/open?id=0B1cH0l8kxYjZeXliWkphOTE2RlU
And here is my TF tree if that can help but it seems all right
https://drive.google.com/open?id=0B1cH0l8kxYjZdXRITmdpZmFaLTQ
I'm relatively new with ROS, sorry if I misunderstand something.
Thank you in advance for your help
↧