4 frame positioned relative to each other
Hi!
Recently, I have started to play in ROS and now I am trying to display 4 frames in RVIZ without success. The problem is that, the frames should be positioned relative to each other and me, with my ignorant brain cant realize the mistake.
static tf2_ros::TransformBroadcaster br;
for (int i = 1; i <= myRobot->getJointNumber(); i++) {
stringstream name, prevName;
name << "{" << i << "}";
prevName << "{" << (i-1) << "}";
geometry_msgs::TransformStamped transformStamped;
transformStamped.header.stamp = ros::Time::now();
transformStamped.header.frame_id = prevName.str();
transformStamped.child_frame_id = name.str();
transformStamped.transform.translation.x = 0.0;
transformStamped.transform.translation.y = 0.0;
transformStamped.transform.translation.z = 0.0;
tf2::Quaternion q;
q.setRPY(0, 0, 0);
transformStamped.transform.rotation.x = q.x();
transformStamped.transform.rotation.y = q.y();
transformStamped.transform.rotation.z = q.z();
transformStamped.transform.rotation.w = q.w();
frames.push_back(transformStamped);
br.sendTransform(transformStamped);
}
Only one or two frames shows up, which are directly linked to the fixed frame.
And here is two image to see how it is shown: https://drive.google.com/file/d/0By6a...
rosrun tf view_frames : https://drive.google.com/file/d/0By6a...
What does the pdf output look like if you run
rosrun tf view_frames
this is the output: https://drive.google.com/file/d/0By6a...
That looks correct. As does your code. Maybe your 30khz update rate is overburdening rviz.
There is no
+1 funny
, otherwise I would've used it here :)Thanks Felix, I found the problem, it is working now!