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

Gudjohnson's profile - activity

2018-01-30 23:02:49 -0500 marked best answer rqt_plot not publishing showing anything

rqt_plot not publishing anything even thought there is data being published on the topic "mytopic". When I do rostopic echo /mytopic I get continious output with parameters changing given as follows(just posted a script out of the big output I am getting) :

  id: 3
    vs: 4

  - 
    id: 10
    vs: 1

  - 
    id: 13
    vs: 6

  - 
    id: 18
    vs: 1

  - 
    id: 19
    vs: 1

  - 
    id: 21
    vs: 8

  - 
    id: 27
    vs: 1

  - 
    id: 31
    vs: 1

However when I do rosrun rqt_plot rqt_plot /mytopic nothing is ouputted. Can somebody help me with this.

2015-05-25 15:53:07 -0500 received badge  Famous Question (source)
2014-09-15 08:17:40 -0500 received badge  Famous Question (source)
2014-03-07 10:10:32 -0500 received badge  Famous Question (source)
2014-02-03 09:33:24 -0500 received badge  Famous Question (source)
2014-01-28 17:31:39 -0500 marked best answer Can I define publishers in a function and then I can call that function in main() file? Can I really?

I just wanted to ask whether I can define my publisher in a function and then call the function in a main() file like the following code sniplet exhibits:

static void myfunct(stream* str, strble *conv, unsigned char *buff, int n){
ros::NodeHandle nh;
ros::Publisher pub_navigation_msg = nh.advertise<rtklib::Navigation>("nav_topic", 10);

rtklib::Navigation navmsg;
navmsg.time= conv->time;

pub_navigation_msg.publish(navmsg);
}


int main(int argc, char** argv){

    ros::Rate r(1); 
    while (ros::ok()){
      myfunct();
    }   
ros::spinOnce();
}
2014-01-28 17:31:39 -0500 marked best answer How can I input a publisher as a parameter to a function?

I am planning on defining the following publisher in a main() file

 ros::Publisher pub_navigation_msg = nh.advertise<rtklib::Navigation>("nav_topic", 10);

But I want to use publisher inside my function so I want to define it as a parameter to the function like

static void myfunct(ros::Publisher pub, stream mymsg){
.....
.....
pub.publish(mymsg);

}

I think I cannot define a publisher outside a main() file because main would consist of Nodehandler and other important ros features.

2014-01-28 17:31:38 -0500 marked best answer ROS determines the size of an array itself? Really

Following the ros code in ros msg format:

Ephemeris[] eph

which is equivalent of this in c:

Ephemeris *eph;

Now I have heard that ros determines itself the size of an array. One does not have to give it size.

Now for the C code inorder for me to iterate in the array I need to know the size of the array but I believe in ros, I dont.

So if I am writing a C code and I want to access the msg format and I want to iterate through the array eph, how can I do it without knowing the size of eph

2014-01-28 17:31:34 -0500 marked best answer Adding Comments in a msg format file

I am a bit confused because at all the sample codes that I have seen on ROS wiki, I have seen that the comments are displayed above the code:

#Standard metadata for higher-level flow data types
#sequence ID: consecutively increasing ID 
uint32 seq
#Frame this data is associated with
string frame_id

Can I place comments infront of the code like:

 uint32 seq        #sequence ID: consecutively increasing ID  #Standard metadata 
 string frame_id   #Frame this data is associated with

Also if you are fine with both, which one is considered a good programming practice

2014-01-28 17:31:22 -0500 marked best answer tf Broadcaster Tutorial error

I am following the TF tutorial http://www.ros.org/wiki/tf/Tutorials/Writing%20a%20tf%20broadcaster%20%28C%2B%2B%29

and I just copy pasted the code from there. When I try to run it, I receive this error

undefined reference to `tf::TransformBroadcaster::sendTransform(tf::StampedTransform const&)

What should I do? Where is the problem associated to?

2014-01-28 17:31:22 -0500 marked best answer tf error undefined reference to undefined reference to `tf::TransformBroadcaster::sendTransform()'

I have the following piece of code

    void poseCallback(const ravedataPtr &msg){
 static tf::TransformBroadcaster br;
      tf::Transform transform;
      transform.setOrigin( tf::Vector3(0,0,0) );
      transform.setRotation( tf::Quaternion(0, 0, 0));
      br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "world", "base_link"));
    }

and I receive this error

     /home/cu/gnss-master/rtkrcv/src/main.cpp:30: undefined reference to `tf::TransformBroadcaster::sendTransform(tf::StampedTransform const&)'

/home/cu/gnss-master/rtkrcv/src/main.cpp:26: undefined reference to `tf::TransformBroadcaster::TransformBroadcaster()'

I tried fixing it but cannot do it. Has anyone else encountered a similar problem ever.

As people asked so I am uploading my CMakelist.txt

cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
#set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

################################################################################
# RTKLIB
################################################################################

#INCLUDE($ENV{ROS_ROOT}/core/rosbuild/FindPkgConfig.cmake)

rosbuild_find_ros_package(rtklib)
MESSAGE(${rtklib_PACKAGE_PATH})
add_subdirectory(${rtklib_PACKAGE_PATH} ${CMAKE_BINARY_DIR}/rtklib)

rosbuild_add_executable(${PROJECT_NAME}
                       src/main.cpp
                       src/ros_options.cpp
                       src/rtkrcv.cpp)
target_link_libraries(${PROJECT_NAME} rtk)

and manifest.xml

<package>
  <description brief="rtkrcv">

     xxxx

  </description>
  <author>John 14</author>
  <license>GPLv3</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/rtkrcv</url>

  <depend package="rtklib"/>
  <depend package="roscpp"/>
  <depend package="roslib"/>
  <depend package="sensor_msgs"/>

</package>
2014-01-28 17:31:21 -0500 marked best answer Writing a publisher node

How do I write some publisher node that computes some coordinates and publishes their position.

How do I transform from a fixed frame like /world to another frame of my choice like /sat1/base_link. I believe tf broadcaster is required for it. Can anybody help me in this.

2014-01-28 17:31:18 -0500 marked best answer Displaying information in TF

I am working on ros and I am getting as output the parameters of satellite changing constantly. When I do rostopic echo /topic_name I get the output of sattelite parameters changing constantly. rostopic tells me that I have successfully published data to the my topic. How can I use this to display my sattelite in TF. Do i have to make a brodcaster/listener or can I do it with adding a node in my launch file like

  node pkg="tf" type="tf_echo" name="tf_whatever" args="0.0 0.0 0.0 0.0 0.0 0.0 /topic_name" />

I am not sure whether this addition to launch file is correct. Any help would be appreciated.

2014-01-28 17:31:14 -0500 marked best answer How to 3D represent model in ROS

Hello people, I just want to have some basic information about this because I am new to ROS. I tried to search it on ROS and on internet but could not find a similar question.

I have to represent a model of different satellites(around 15) using features from Ros. The parameters of the sattelites(coordinates, speed e.t.c) are constantly changing overtime and I have to represent their movement in 3D. Can you please tell me how can I represent all of them graphically while all of them are moving relative to time. Somebody told me that I can do it through rviz or rqt but I am not quite sure. Any help would be appreciated.

2013-11-25 07:20:13 -0500 received badge  Famous Question (source)
2013-11-14 11:22:53 -0500 received badge  Notable Question (source)
2013-11-14 11:22:06 -0500 received badge  Popular Question (source)
2013-11-14 11:18:09 -0500 received badge  Famous Question (source)
2013-11-06 12:58:54 -0500 received badge  Famous Question (source)
2013-11-05 14:17:18 -0500 received badge  Notable Question (source)
2013-10-22 23:21:43 -0500 received badge  Taxonomist
2013-09-22 22:39:18 -0500 received badge  Famous Question (source)
2013-08-30 05:28:13 -0500 received badge  Notable Question (source)
2013-08-30 05:27:17 -0500 received badge  Notable Question (source)