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

how can i plot pose link3 in rqt for RRRBOT ? [closed]

asked 2017-03-10 13:41:08 -0500

zakizadeh gravatar image

hi . i wrote a tf_listener for RRRBOT and add node in launch file like this : <node pkg="rrrbot_files" type="rrrbot_files_tf_listener" name="listener" output="screen"/> how can i plot pose link3 in rqt ??

my rrrbot_files_tf_listener :

    #include <ros/ros.h>
#include <tf/transform_listener.h>
#include <sensor_msgs/JointState.h>

//generic C/C++ include
#include <string>
#include <sstream>
#include <ros/console.h>

int main(int argc, char** argv){
  ros::init(argc, argv, "rrrbot_files_tf_listener");

  ros::NodeHandle node;

  sensor_msgs::JointState jointstate_msg;
  jointstate_msg.header.stamp = ros::Time(0);"joint1");"joint2");
  //reset the messages
  // jointstate_msg.position.clear();
  // jointstate_msg.velocity.clear();
  // jointstate_msg.effort.clear();
  ros::Publisher pub_datainfo_joints;
  pub_datainfo_joints=node.advertise<sensor_msgs::JointState>(node.resolveName("/calibrated/joint_states"), 10);

  tf::TransformListener listener;

  ros::Rate rate(10.0);
  while (node.ok()){
    tf::StampedTransform transform;
    try {
    //listener.waitForTransform("/second_link", "/base_link", ros::Time(0), ros::Duration(10.0) );
    listener.lookupTransform("/link3", "/link1", ros::Time(0), transform);
    ROS_INFO("Translation = %f,%f,%f", transform.getOrigin().x(),transform.getOrigin().y(),transform.getOrigin().z());
    } catch (tf::TransformException ex) {
  return 0;
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by NEngelhard
close date 2017-03-18 07:45:08.362831

1 Answer

Sort by ยป oldest newest most voted

answered 2017-03-17 19:48:25 -0500

130s gravatar image

You can plot topics on rqt_plot as long as they are published. You seem to have asked similar questions about plotting over and over. I suggest you go through the tutorial set, particularly Understanding ROS Topics.

In case you've been asking how to plot topics from code (i.e. not by manual operation on GUI), I don't know if there's a way to do that easily. Here's a previous question that hasn't been answered yet.

edit flag offensive delete link more


how publish topic pose ?

zakizadeh gravatar image zakizadeh  ( 2017-04-07 04:15:33 -0500 )edit

Question Tools

1 follower


Asked: 2017-03-10 13:41:08 -0500

Seen: 182 times

Last updated: Mar 17 '17