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

Tuan's profile - activity

2018-09-17 10:46:38 -0500 received badge  Enlightened (source)
2018-09-17 10:46:38 -0500 received badge  Good Answer (source)
2016-11-18 07:31:47 -0500 received badge  Nice Answer (source)
2014-01-28 17:23:18 -0500 marked best answer Publish a latched message in rosjava

Hi,

I am trying to publish a latched message in rosjava so that my arduino only receives a command when it is different than the preivous one. Currently, it is constantly polling and that makes my program not to work.

In roscpp, I know that you can set the boolean latch = true.

Is there an equivalent in rosjava?

Thanks.

2014-01-28 17:23:15 -0500 marked best answer error while loading shared libraries: libros.so: cannot open shared object file: No such file or directory

I am using ROS Diamondback on Ubuntu 10.10.

I was running my ROS node without problem until I tried ssh to run a rosnode from a remote machine.

After that, on my own machine, when I run I ROS node which has been working fine earlier using rosrun, I encountered this error message:

error while loading shared libraries: libros.so: cannot open shared object file: No such file or directory

Any pointers on how to fix this please? Thank you very much.

2014-01-28 17:23:13 -0500 marked best answer cannot detect file - file path problem?

Hi,

Sorry if this is a dumb question but I am trying to use openCV with ROS to load an .avi file unsuccessfully.

To test out video loading, I used a very simple sample code online http://nashruddin.com/How_to_Play_AVI_Files_with_OpenCV and just modify line 22 to change the argument from argv[1] to "myvideo.avi" which is in the same folder as the source. I compile using g++ and it works as expected.

When I put that same source file into a ROS package my_ros_package/src and compile in ROS, the executable goes into my_ros_package/bin. So I tried putting myvideo.avi into both /bin and /src. Although the program compile fine using rosmake or make, when I load the executable, the code would return at line 25, implying that the .avi file could not be found.

I also tried various ways such as using rosrun or ./bin/my_executatble in my_ros_package or ./my_executable in my_ros_package/bin, all gave the same error.

Interestingly, if I only load an image instead of an .avi from the same code (using cvLoadImage("myimage.png"), the image can be diplayed when it is in the /bin folder and using ./my_executable in my_ros_package/bin.

I thought this could be a codec problem, I fixed it as suggested in the same link with the sample code, however, that did not work. Also, please note that the .avi could be played by using g++ for compiling and having the .avi file in the same folder with the source.

I am guessing the problem lies in the way ROS is setting its PATH. Could any one help out with this please?

Below is my source code

the video file & source file is in the same ros_package/src/ folder

This is the code that does not work as I compile from rosmake. The output returns "Cannot capture from AVI"

   #include <stdio.h>
    #include <iostream>
    #include "cv.h"
    #include "highgui.h"
    #include "ros/ros.h"
    #include "ros/package.h"


using namespace std;
using namespace ros::package;

int main( int argc, char** argv )
{
    IplImage  *frame;
    int key = 0;

    std::string DIR = getPath("iCharibot_face");
    std::string PATH = DIR + "/src/Talking4.avi";
    cout << "PATH " << PATH << endl;

    /* load the AVI file */
    CvCapture *capture = cvCaptureFromAVI(PATH.c_str());
    if(!capture){
         printf("Cannot capture from AVI.\n");
    }

    /* get fps, needed to set the delay */
    int fps = ( int )cvGetCaptureProperty( capture, CV_CAP_PROP_FPS );
   //int fps = 30;
    /* display video */
    cvNamedWindow( "video", 0 );

    while( key != 'q' ) {
        /* get a frame */
        frame = cvQueryFrame( capture );
        /* always check */
        if( !frame ) break;
        /* display frame */
        cvShowImage( "video", frame );

        /* quit if user press 'q' */
        key = cvWaitKey( 1000 / fps );
    }

    /* free memory */
    cvReleaseCapture( &capture );
    cvDestroyWindow( "video" );

    return 0;
}

The same code works fine even if I do not use the PATH when I use g++ to compile (I have to remove all the ros include to compile in g++). The Talking4.avi video is animated.

#include <stdio.h>
#include <iostream>
#include "cv.h"
#include "highgui.h"


using namespace std;

int main( int argc, char** argv )
{
    IplImage  *frame;
    int key = 0;

    /* load the ...
(more)
2014-01-28 17:23:11 -0500 marked best answer Data logging with rosbag in rosjava

Hi,

I am currrently using rosjava to create an control interface on my tablet to control a robot. Everything works fine except that rosbag does not record information from the nodes created by rosjava.

May I know if this logging feature has been supported for rosjava? If yes then how to enable it? Thank you very much.

2014-01-28 17:23:11 -0500 marked best answer Could not initialise Stage with Segmentation fault error

Hi,

I am new to ROS so please help me with this.

I follow the tutorial to set up Stage and everything was fine until I am trying to use stageros to load an existing world file (also part of the tutorial)

Input:

tuan@tuan-laptop:/opt/ros/diamondback/stacks/simulator_stage/stage$ ./bin/stageros world/willow-erratic.world

Output:

Segmentation fault.

The error message is too simple and do not provide much information for me to debug. Please help.

Thanks very much.

Tuan.

2014-01-28 17:22:35 -0500 marked best answer Accessing map_server using rosjava

Hi,

I am trying to access the map_server through a client service call to retrieve map information through nav_msgs/OccupancyGrid into my android device using pure implementation Rosjava. However, it seems that there is currently no support for that in Rosjava.

Could anyone help me if you have tried and solved a similar problem?

Thank you very much.

2014-01-28 17:22:34 -0500 marked best answer Rosjava image_transport tutorial - no image display on android tablet despite successful compilation

Hi, 

I am trying out the rosjava image_transport tutorial by importing it as an android project in Eclipse and port it to a Motorola Xoom.

To get the sample code to compile, I have modified it slightly (see code fragment below) and also delete the line in main.xml that contains the android:src=”@drawable/” as it could not be resolved.

Problem:

Image is not displayed although checks show that the node is connected to host PC roscore (rxgraph shows android node and shows that it subscribes to /camera/image/compressed for the correct message sensor_msgs/CompressedImage)

I have tried to call a similar subscriber node - code from ( http://www.ros.org/wiki/image_transpo... ) on my PC and I can retrieve a static image. I look through the code for this node and it required OpenCV to display the image through the bridge class.

For the Xoom, I guess I just miss one line of code that call the image to display on the Xoom. I look through the RosImageView class and I guess the line image.setMessageToBitmapCallable(new BitmapFromCompressedImage()); will serve a similar function.

However, no image is shown on the Xoom.

Could any one offer help on this please?

Please refer to the code fragment below and my configuration.

...   public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

    setContentView(R.layout.main);

//1. Initialise connection to host PC here    

try {

//2.1 First manually set the URI & port of MASTER node (the node that contains roscore)   

java.net.URI master_uri = new java.net.URI("http://129.31.193.253:11311");

   //2.2 Assign the configuration to the tablet with its own address so that roscore can talk back to

  nodeConfiguration = NodeConfiguration.newPublic("129.31.202.25",master_uri);

   //2.3 Add the master URI & port set up in 2.1 to the configuration

  nodeConfiguration.setMasterUri(master_uri);

} catch (Exception e) {

  throw new RuntimeException(e);

}

//retrieving the image from host

    image = (RosImageView<compressedimage>) findViewById(R.id.image_);

    image.setTopicName("/camera/image/compressed");

    image.setMessageType("sensor_msgs/CompressedImage");

    image.setMessageToBitmapCallable(new BitmapFromCompressedImage());

//    startActivityForResult(new Intent(this, MasterChooser.class), 0); // comment because causing forced close

    try{

     nodeRunner.run(image,nodeConfiguration);

    }

    catch(Exception e){

     throw new RuntimeException(e);

    }     

  }

My configuration is as follows:

Basic

  • Ubuntu 10.10 

  • ROSDiamondback

  • Porting into a Motorola Xoom (wifi) – android API level 11 (but I compile at level 9)

  • Have already successfully tested RosjavaPubSub tutorial

ROS

  • Host PC running roscore

  • Host PC running image_transport publisher that publishes a static image - exactly the same code as the tutorial at

http://www.ros.org/wiki/image_transpo...

2014-01-28 17:22:27 -0500 marked best answer Problem starting rviz with OGRE EXCEPTION(7:InternalErrorException)

Hi,

I am new to ROS. As I am trying to start rviz following the tutorial, I receive this error message right after issuing "rosrun rviz rviz". Please help me if you know the solution. Thanks.

Tuan

Failed to initialize Ogre: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library Plugin_CgProgramManager. System Error: Plugin_CgProgramManager.so: cannot open shared object file: No such file or directory in DynLib::load at /tmp/buildd/ros-diamondback-visualization-common-1.4.1/debian/ros-diamondback-visualization-common/opt/ros/diamondback/stacks/visualization_common/ogre/build/ogre_src_v1-7-1/OgreMain/src/OgreDynLib.cpp (line 91)

2012-12-27 20:40:19 -0500 received badge  Nice Question (source)
2012-12-06 23:09:29 -0500 received badge  Popular Question (source)
2012-12-06 23:09:29 -0500 received badge  Notable Question (source)
2012-12-06 23:09:29 -0500 received badge  Famous Question (source)
2012-12-06 04:35:36 -0500 received badge  Popular Question (source)
2012-12-06 04:35:36 -0500 received badge  Famous Question (source)
2012-12-06 04:35:36 -0500 received badge  Notable Question (source)
2012-11-13 12:13:25 -0500 received badge  Famous Question (source)
2012-11-13 12:13:25 -0500 received badge  Notable Question (source)
2012-10-15 04:20:06 -0500 received badge  Notable Question (source)
2012-10-15 04:20:06 -0500 received badge  Famous Question (source)
2012-10-15 04:20:06 -0500 received badge  Popular Question (source)
2012-09-11 15:43:41 -0500 received badge  Famous Question (source)
2012-09-11 15:43:41 -0500 received badge  Popular Question (source)
2012-09-11 15:43:41 -0500 received badge  Notable Question (source)
2012-08-27 01:43:43 -0500 received badge  Notable Question (source)
2012-08-27 01:43:43 -0500 received badge  Famous Question (source)
2012-08-27 01:43:43 -0500 received badge  Popular Question (source)
2012-08-20 03:17:03 -0500 received badge  Famous Question (source)
2012-08-20 03:17:03 -0500 received badge  Notable Question (source)