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

ajr_'s profile - activity

2014-03-20 18:39:34 -0500 received badge  Famous Question (source)
2014-02-19 09:48:02 -0500 received badge  Notable Question (source)
2014-02-11 05:47:34 -0500 commented answer How to utilize libserial with ROS -Ubuntu 12.04 - Hydro

Ok, actually missing the main function & node. Beginners mistake... This problem is solved, thanks to all for the help!

2014-02-11 05:32:41 -0500 commented answer How to utilize libserial with ROS -Ubuntu 12.04 - Hydro

the new problem is this error, not sure if its still related to linking: /usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start': (.text+0x20): undefined reference to `main'

2014-02-11 05:29:30 -0500 commented answer How to utilize libserial with ROS -Ubuntu 12.04 - Hydro

ok this works, although there is another error now but its not related to this question anymore.

2014-02-11 05:16:20 -0500 received badge  Popular Question (source)
2014-02-11 04:24:00 -0500 commented answer How to utilize libserial with ROS -Ubuntu 12.04 - Hydro

I updated my question and it seems I do not have the correct library name which to use for linking?

2014-02-10 08:06:35 -0500 asked a question How to utilize libserial with ROS -Ubuntu 12.04 - Hydro

I have an old ROS Fuerte project which code i wanted to reuse in an another ROS Hydro node, this code uses libserial library. I have a problem to find out the correct way to include this library into my new node via CMakeList.txt

Here what i include in my header:

#include <SerialStream.h>
using namespace LibSerial;
SerialStream fd;

I'm not totally sure where the error comes from but doesn't the "undefined reference" mean that problem could be within the compiling and linking?

Here is the error code:

####
#### Running command: "make cmake_check_build_system" in "/home/x/Dropbox/catkin_ws/build"
####
####
#### Running command: "make -j2 -l2" in "/home/x/Dropbox/catkin_ws/build"
####
[  0%] [  0%] Built target std_msgs_generate_messages_cpp
Built target std_msgs_generate_messages_py
[ 20%] [ 20%] Built target std_msgs_generate_messages_lisp
Built target serial_interface_generate_messages_cpp
[ 60%] [ 80%] Built target serial_interface_generate_messages_py
Built target serial_interface_generate_messages_lisp
[ 80%] Built target serial_interface_generate_messages
Linking CXX executable /home/x/Dropbox/catkin_ws/devel/lib/serial_interface/serial_interface
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
CMakeFiles/serial_interface.dir/src/serial_interface.cpp.o: In function `CA::RoverInterface::RoverInterface(ros::NodeHandle)':
serial_interface.cpp:(.text+0x514): undefined reference to `LibSerial::SerialStream::Open(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::_Ios_Openmode)'
CMakeFiles/serial_interface.dir/src/serial_interface.cpp.o:(.rodata._ZTVN9LibSerial15SerialStreamBufE[vtable for LibSerial::SerialStreamBuf]+0x48): undefined reference to `LibSerial::SerialStreamBuf::showmanyc()'
CMakeFiles/serial_interface.dir/src/serial_interface.cpp.o:(.rodata._ZTVN9LibSerial15SerialStreamBufE[vtable for LibSerial::SerialStreamBuf]+0x50): undefined reference to `LibSerial::SerialStreamBuf::xsgetn(char*, long)'
CMakeFiles/serial_interface.dir/src/serial_interface.cpp.o:(.rodata._ZTVN9LibSerial15SerialStreamBufE[vtable for LibSerial::SerialStreamBuf]+0x58): undefined reference to `LibSerial::SerialStreamBuf::underflow()'
CMakeFiles/serial_interface.dir/src/serial_interface.cpp.o:(.rodata._ZTVN9LibSerial15SerialStreamBufE[vtable for LibSerial::SerialStreamBuf]+0x68): undefined reference to `LibSerial::SerialStreamBuf::pbackfail(int)'
CMakeFiles/serial_interface.dir/src/serial_interface.cpp.o:(.rodata._ZTVN9LibSerial15SerialStreamBufE[vtable for LibSerial::SerialStreamBuf]+0x70): undefined reference to `LibSerial::SerialStreamBuf::xsputn(char const*, long)'
CMakeFiles/serial_interface.dir/src/serial_interface.cpp.o:(.rodata._ZTVN9LibSerial15SerialStreamBufE[vtable for LibSerial::SerialStreamBuf]+0x78): undefined reference to `LibSerial::SerialStreamBuf::overflow(int)'
collect2: ld returned 1 exit status
make[2]: *** [/home/x/Dropbox/catkin_ws/devel/lib/serial_interface/serial_interface] Error 1
make[1]: *** [serial_interface/CMakeFiles/serial_interface.dir/all] Error 2
make: *** [all] Error 2

EDIT 1:

I have updated my CMakeList.txt file to be as follows with the new information I got from an answer:

cmake_minimum_required(VERSION 2.8.3)
project(serial_interface)

find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  message_generation
)

include_directories(include ${catkin_INCLUDE_DIRS})

 add_message_files(
   FILES
   Control.msg
 )

generate_messages(
   DEPENDENCIES
   std_msgs
 )

catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp rospy std_msgs message_runtime
)

add_executable(serial_interface src/serial_interface.cpp)
add_dependencies(serial_interface serial_interface_generate_messages_cpp)

target_link_libraries(serial_interface
   ${catkin_LIBRARIES}
   libserial0
 )

 install(DIRECTORY include/${PROJECT_NAME}/
   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
   FILES_MATCHING PATTERN "*.h"
   PATTERN ".svn" EXCLUDE
 )

And if i run dpkg -L libserial0

I do get the following:

/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/libserial0
/usr/share/doc/libserial0/copyright
/usr/share/doc/libserial0/changelog.Debian.gz
/usr/lib
/usr/lib/libserial.so.0.0.0
/usr/lib/libserial.so.0

Therefore I should have the correct library installed on my system ... (more)

2014-01-28 17:26:04 -0500 marked best answer Threading function - udp client integration to a Ros node

Hi,

I have working ROS node with callBacks for subscriptions, and also with timers like this:

timer= nh.createTimer(ros::Duration(0.050), &Control::spin,this); // 20Hz
void Control::spin(const ros::TimerEvent & e)

But I would like to create additional function which connects to a UDP server and ask data. For this I need to create own function which would run as separate loop alongside other node callBacks. How should i create this, with help of what kind of tools? I guess timer is not the best solution because of constant Hz in loop.

My control node current structure:


int main(int argc, char **argv)
{
    printf("*************************************\n");

    ros::init(argc, argv, "control");
    ros::NodeHandle n;
    Control Mcontrol(n);

    ros::spin();
    return 0;
}

Control class requires itself quite fast response time to its tasks. It subscribes to IMU data ~20Hz and camera coordinate data would be obtained with help of UDP. UDP should be as fast as possible.

All tips are highly appreciated. Thanks.

EDIT: At the moment too busy to try solve this problem this way. Made separate node for UDP-client. Maybe later try to integrate them in to one node. I'm unsure will this make any difference latency wise?

2014-01-28 17:25:48 -0500 marked best answer simple question about #include </control_toolbox/pid.h>

First question about includes

OS: Ubuntu 12.04 64bit ROS: Fuerte

I'm trying to use control_toolbox node as part of my ROS project. This control_toolbox node I have installed manually by svn co the source, building it with rosmake and making sure roscd can find it.

I have included in the beginning of my project header-file

#include < /control_toolbox/pid.h >

But for some reason with this include I always get error:

fatal error: /control_toolbox/pid.h: No such file or directory

On the other hand if I include the whole path to control_toolbox pid.h file

#include < /home/user/ros_workspace/control_toolbox/include/control_toolbox/pid.h >

i do not receive previous error.

Second question about implementing control_toolbox

Also as a secondary question I'm curious how to implement control_toolbox for my use. I have tried following:

  • In header mkcontrol.h
namespace project
{
    class ProjectControl
    {
        private:    
        public: 
            control_toolbox::Pid pid_vel_x;
    };
}
  • In cpp file
#include "project_control/mkcontrol.h"
using namespace project;
using namespace control_toolbox;
//{
    ProjectControl::ProjectControl(ros::NodeHandle nh):
    n(nh)
    {
    pid_vel_x.initPid( 25 , 5 , 0 , 10 , -10 );
    }

Just a simple example how i was planning to use it, but i receive following errors (by error i'm referring to these undefined reference outputs from rosmake):

  Linking CXX executable ../bin/project_control
  CMakeFiles/project_control.dir/src/control_node.o: In function `~ProjectControl':
  ~/mkcontrol.h:58: undefined reference to `control_toolbox::Pid::~Pid()'
  CMakeFiles/project_control.dir/src/mkcontrol.o: In function `ProjectControl':
  ~/mkcontrol.cpp:45: undefined reference to `control_toolbox::Pid::Pid(double, double, double, double, double)'
  ~/mkcontrol.cpp:90: undefined reference to `control_toolbox::Pid::initPid(double, double, double, double, double)'
  ~/mkcontrol.cpp:45: undefined reference to `control_toolbox::Pid::~Pid()'
  collect2: ld returned 1 exit status
  make[3]: *** [../bin/project_control] Error 1
  make[3]: Leaving directory `...'
  make[2]: *** [CMakeFiles/project_control.dir/all] Error 2
  make[2]: Leaving directory `...'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `...'

After editing manifest.xml

I receive following error while trying to rosmake my node:

  [100%] Building CXX object CMakeFiles/project_control.dir/src/mkcontrol.o
  Linking CXX executable ../bin/project_control
  /home/user/ros_workspace/control_toolbox/lib/libcontrol_toolbox.so: undefined reference to `TiXmlElement::Attribute(char const*) const'
  collect2: ld returned 1 exit status
  make[3]: *** [../bin/project_control] Error 1
  make[3]: Leaving directory `~/project_control/build'
  make[2]: *** [CMakeFiles/project_control.dir/all] Error 2
  make[2]: Leaving directory `~/project_control/build'
  make[1]: *** [all] Error 2
  make[1]: Leaving directory `~/project_control/build'

If I run make with VERBOSE=1 flag the compilation command with all includes is visible:

Linking CXX executable ../bin/project_control
/usr/bin/cmake -E cmake_link_script CMakeFiles/project_control.dir/link.txt --verbose=1
/usr/bin/c++   -O2 -g    -Wl,-rpath,~/ROS/control_toolbox/lib -Wl,-rpath,/opt/ros/fuerte/stacks/geometry/tf/lib -Wl,-rpath,/opt/ros/fuerte/stacks/bullet/lib -pthread CMakeFiles/project_control.dir/src/control_node.o CMakeFiles/project_control.dir/src/mkcontrol.o  -o ../bin/project_control -rdynamic -L/opt/ros/fuerte/lib -L~/ROS/control_toolbox/lib -L/opt/ros/fuerte/stacks/geometry/tf/lib -L/opt/ros/fuerte/stacks/bullet/lib -lcontrol_toolbox -ltf ...
(more)
2014-01-28 17:25:12 -0500 marked best answer Gscam compilation error on Gumstix running Ubuntu 11.04

I am trying to install gscam on a Gumstix Overo COM. I have successfully installed the base ROS electric functions such as roscore, rosmake, etc. and I can run roscore. However, rosdep is not able to install yaml-cpp nor tinyxml on the Gumstix's ARM processor. Thus, I tried to install the packages from source:

yaml-cpp : http://code.google.com/p/yaml-cpp/downloads/list

tinyxml : http://code.google.com/p/libtinyxml/

yaml program compiled/installed natively with: cmake, make, sudo make install. Tinyxml I installed by following command: sudo apt-get install libtinyxml-dev

Also I installed necessary dependencies required by gscam:

Image common

svn co https://code.ros.org/svn/ros-pkg/stacks/image_common/tags/electric image_common

common msgs

svn co https://code.ros.org/svn/ros-pkg/stacks/common_msgs/tags/electric common_msgs

pluginlib

hg clone https://kforge.ros.org/common/pluginlib -r electric

common rosdeps

hg clone https://kforge.ros.org/common/rosdepcore -r electric


But still problem is still present, I receive following error while trying to compile gscam package:

robot@overo:~/ros_packages/gscam$ rosmake --rosdep-install gscam
[ rosmake ] Packages requested are: ['gscam']                                                                                   
[ rosmake ] Logging to directory/home/robot/.ros/rosmake/rosmake_output-20120327-190214                                         
[ rosmake ] Expanded args ['gscam'] to:
['gscam']                                                                               
[ rosmake ] Generating Install Script using rosdep then executing. This may take a minute, you will be prompted for permissions. . .
Failed to find rosdep yaml-cpp for package gscam on OS:ubuntu version:11.04
Failed to find rosdep tinyxml for package gscam on OS:ubuntu version:11.04
WARNING: Rosdeps [u'yaml-cpp', u'tinyxml'] could not be resolved
rosdep executing this script:
{{{
set -o errexit
#No Packages to install
}}}
[ rosmake ] rosdep successfully installed all system dependencies                                                               
[ rosmake ] Starting >>> tools/rospack                                                                                          
[ rosmake ] Finished <<< tools/rospack                                                                                          
[rosmake-0] Starting >>> rosbuild [ make ]                                                                                      
[rosmake-0] Finished <<< rosbuild  No Makefile in package rosbuild                                                              
[rosmake-0] Starting >>> roslang [ make ]                                                                                       
[rosmake-0] Finished <<< roslang  No Makefile in package roslang                                                                
[rosmake-0] Starting >>> cpp_common [ make ]                                                                                    
[rosmake-0] Finished <<< cpp_common [PASS] [ 5.87 seconds ]                                                                     
[rosmake-0] Starting >>> roscpp_traits [ make ]                                                                                 
[rosmake-0] Finished <<< roscpp_traits [PASS] [ 4.92 seconds ]                                                                  
[rosmake-0] Starting >>> rostime [ make ]                                                                                       
[rosmake-0] Finished <<< rostime [PASS] [ 13.12 seconds ]                                                                       
[rosmake-0] Starting >>> roscpp_serialization [ make ]                                                                          
[rosmake-0] Finished <<< roscpp_serialization [PASS] [ 5.48 seconds ]                                                           
[rosmake-0] Starting >>> roslib [ make ]                                                                                        
[rosmake-0] Finished <<< roslib [PASS] [ 9.30 seconds ]                                                                         
[rosmake-0] Starting >>> xmlrpcpp [ make ]                                                                                      
[rosmake-0] Finished <<< xmlrpcpp [PASS] [ 5.66 seconds ]                                                                       
[rosmake-0] Starting >>> rosconsole [ make ]                                                                                    
[rosmake-0] Finished <<< rosconsole [PASS] [ 17.61 seconds ]                                                                    
[rosmake-0] Starting >>> std_msgs [ make ]                                                                                      
[rosmake-0] Finished <<< std_msgs [PASS] [ 44.36 seconds ]                                                                      
[rosmake-0] Starting >>> rosgraph_msgs [ make ]                                                                                 
[rosmake-0] Finished <<< rosgraph_msgs [PASS] [ 8.57 seconds ]                                                                  
[rosmake-0] Starting >>> roscpp [ make ]                                                                                        
[rosmake-0] Finished <<< roscpp [PASS] [ 18.71 seconds ]                                                                        
[rosmake-0] Starting >>> rospy [ make ]                                                                                         
[rosmake-0] Finished <<< rospy [PASS] [ 12.29 seconds ]                                                                         
[rosmake-0] Starting >>> rosclean [ make ]                                                                                      
[rosmake-0] Finished <<< rosclean [PASS] [ 5.30 seconds ]                                                                       
[rosmake-0] Starting >>> rosgraph [ make ]                                                                                      
[rosmake-0] Finished <<< rosgraph [PASS] [ 5.78 seconds ]                                                                       
[rosmake-0] Starting >>> rosparam [ make ]                                                                                      
[rosmake-0] Finished <<< rosparam [PASS] [ 5.15 seconds ]                                                                       
[rosmake-0] Starting >>> rosmaster [ make ]                                                                                     
[rosmake-0] Finished <<< rosmaster [PASS] [ 4.93 seconds ]                                                                      
[rosmake-0] Starting >>> rosout [ make ]                                                                                        
[rosmake-0] Finished <<< rosout [PASS] [ 5.55 seconds ]                                                                         
[rosmake-0] Starting >>> roslaunch [ make ]                                                                                     
[rosmake-0] Finished <<< roslaunch  No Makefile in package roslaunch                                                            
[rosmake-0] Starting >>> rosunit [ make ]                                                                                       
[rosmake-0] Finished <<< rosunit [PASS] [ 4 ...
(more)
2014-01-28 17:25:00 -0500 marked best answer Gumstix, caspa camera and Ubuntu 11.04

Hi,

Is there any previous work done with this combination? Ubuntu on Gumstix is running (GNU/Linux 2.6.36 armv7l). Also would the ROS ucv_camera package be useful for camera access or maybe there are some other better options?

Thanks

2013-06-02 07:17:50 -0500 marked best answer ros_master_uri - change it and save it

Hi,

Is there a simple way to store change of ROS_MASTER_URI? So when ever I boot up my machine (or start node) this would always be changed to for example:

export ROS_MASTER_URI=http://ubuntu:11311

Now it changes always back to default

$ echo $ROS_MASTER_URI 
http://localhost:11311
2013-04-04 02:22:22 -0500 received badge  Taxonomist
2012-12-02 13:33:41 -0500 received badge  Famous Question (source)
2012-12-02 13:33:41 -0500 received badge  Notable Question (source)
2012-12-02 13:33:41 -0500 received badge  Popular Question (source)
2012-11-25 08:54:55 -0500 marked best answer Subscribe to a topic and trigger two Callback functions

Hi,

I want to trigger two Callback functions by same message data. And to be able to execute Callbacks at the same rate as publication happens. At the moment I have it with following initialization code. What would be the correct way to do it?

ImuSubscriber = nh.subscribe ("/mikrokopter/fc_debug", 100, &MikrokopterControl::mikoImuCallback, this);

HeightSubscriber = nh.subscribe ("/mikrokopter/fc_debug", 100, &MikrokopterControl::heightCallback, this);

The goal is to call two different Callbacks as far as i understood. I want the published message data into two different functions and they to be executed when ever new data is available from publisher.

2012-11-25 08:52:54 -0500 received badge  Popular Question (source)
2012-11-25 08:52:54 -0500 received badge  Famous Question (source)
2012-11-25 08:52:54 -0500 received badge  Notable Question (source)
2012-09-11 22:33:36 -0500 marked best answer ubuntu 11.10, ROS electric and TiXmlElement ( tinyxml ) compiling error

/opt/ros/electric/stacks/pr2_controllers/control_toolbox/lib/libcontrol_toolbox.so: undefined reference to TiXmlElement::Attribute(char const*) const' collect2: ld returned 1 exit status

I have following compilation error and don't have any idea how to solve it. I think it might be linked to this following problem: http://answers.ros.org/questions/2296/revisions/ But still quite don't know how to solve this.

EDIT: After doing fresh install of ROS to ubuntu I get this error msg:

Failed to find stack for package [control_toolbox] Failed to load rosdep.yaml for package [control_toolbox]:Cannot locate installation of package control_toolbox: [rospack] couldn't find package [control_toolbox].

What would be the correct way to fix this? I think last time I used apt-get to instal necessary library.

2012-09-06 14:06:58 -0500 received badge  Famous Question (source)