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

Saphrosit's profile - activity

2022-02-03 15:33:32 -0500 received badge  Good Answer (source)
2015-12-01 10:12:39 -0500 received badge  Guru (source)
2015-12-01 10:12:39 -0500 received badge  Great Answer (source)
2015-01-26 11:19:30 -0500 received badge  Good Question (source)
2015-01-26 11:19:13 -0500 received badge  Enlightened (source)
2015-01-26 11:19:13 -0500 received badge  Good Answer (source)
2014-10-24 11:57:06 -0500 received badge  Nice Answer (source)
2014-10-24 11:45:39 -0500 received badge  Nice Question (source)
2014-01-28 17:28:35 -0500 marked best answer Flat PointCloud with Turtlebot simulated kinect

Hi, I'm trying to acquire the point cloud from the simulated kinect in the Turtlebot. However, when I try to visualize the point cloud with rviz, the point cloud looks "flat", as if (almost) all the points got projected on a plane. On the right you can see a (small) image representing what the world actually is.

image description

I just followed the tutorial to simulate the turtlebot.

Anyone else faced a similar issue? Any suggestion?

2014-01-28 17:28:08 -0500 marked best answer Wrong publishing rate using ros::Rate

Hi, I was trying to use ros::Rate to control the publishing rate. However for some reason, the publishing rate obtained is not the one I expected.

Here's my code:

ros::Publisher pub1,pub2;
ros::Rate *r1,*r2; 

void callbackInt(const std_msgs::Int16ConstPtr& msg) {
    pub1.publish(msg);
    r1->sleep();
} 

void callbackString(const std_msgs::StringConstPtr& msg) {
    pub2.publish(msg);
    r2->sleep();
} 

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

    ros::init (argc, argv, "test");
    ros::NodeHandle nh;

    ros::Subscriber sub = nh.subscribe ("/int", 1, callbackInt );
    pub1 = nh.advertise<std_msgs::Int16> ("/pubInt", 1);

    ros::Subscriber sub2 = nh.subscribe ("/string", 1, callbackString );
    pub2 = nh.advertise<std_msgs::String> ("/pubString", 1);

    ros::Rate rate(5);
    r1 = &rate;
    ros::Rate rate2(5);
    r2 = &rate2;

    ros::spin();
}

The code should be pretty straightforward: basically I'm subscribing to two different topics (/int and /string) and re-publishing on different topics (/pubInt and /pubString) at different 5 hz (their original rate was different).

However, if I try to check the actual rate with rostopic hz I get 5 hz for /pubInt but half the rate (2.5) for /pubString. Any suggestion? Am I doing something wrong?

2014-01-28 17:26:15 -0500 marked best answer Flush subscription

I have a Ros::Subscriber that receives messages from a topic. Since I'm doing some computations on the data I receive (and it requires some time), the delay with which I read new messages tend to increase.

Is there a way to "flush" all the unread messages in a topic so that I can read directly the newest one? (I'm using electric on ubuntu 11.10)

2014-01-28 17:26:14 -0500 marked best answer Error when using PCLVisualizer

I was trying to use PCLVisualizer in a node but when I try to compile (using rosmake) I get as error

/usr/bin/ld: CMakeFiles/viz.dir/src/cluster_visualizer.o: undefined reference to symbol 'vtkSmartPointerBase::operator=(vtkObjectBase*)'
/usr/bin/ld: note: 'vtkSmartPointerBase::operator=(vtkObjectBase*)' is defined in DSO /usr/lib/libvtkCommon.so.5.6 so try adding it to the linker command line
/usr/lib/libvtkCommon.so.5.6: could not read symbols: Invalid operation

Here's the CMakeLists.txt I use

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

rosbuild_init()

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/include/cluster_extraction )

list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS})

rosbuild_add_executable(viz src/cluster_visualizer.cpp)

and here's the source code:

#include <iostream>
#include <boost/thread/thread.hpp>
#include <pcl/common/common_headers.h>
#include <pcl/io/pcd_io.h>
#include <pcl/visualization/pcl_visualizer.h>

int main () {

    pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
    pcl::io::loadPCDFile<pcl::PointXYZ> ("/tmp/pointCloud0.pcd", *cloud);

    boost::shared_ptr<pcl::visualization::PCLVisualizer> viewer (new pcl::visualization::PCLVisualizer ("3D Viewer"));
    viewer->setBackgroundColor (0, 0, 0);
    viewer->addPointCloud<pcl::PointXYZ> (cloud, "sample cloud");
    viewer->setPointCloudRenderingProperties (pcl::visualization::PCL_VISUALIZER_POINT_SIZE, 1, "sample cloud");
    viewer->addCoordinateSystem (1.0);
    viewer->initCameraParameters ();

    viewer->spin();
}

Any suggestion on how can I fix? I'm using Ubuntu 11.10 with electric

EDIT:

my manifest.xml is

<package>
  <description brief="cluster_extraction">

     cluster_extraction

  </description>
  <author>Manlio</author>
  <license>BSD</license>
  <review status="unreviewed" notes=""/>
  <url>http://ros.org/wiki/cluster_extraction</url>
  <depend package="roscpp"/>
  <depend package="std_msgs"/>
  <depend package="sensor_msgs"/>
  <depend package="pcl"/>
  <depend package="pcl_ros"/>
  <depend package="common_rosdeps" />

  <rosdep name="eigen" />

</package>
2014-01-28 17:26:07 -0500 marked best answer Gazebo: undefined symbol: _ZTIN6gazebo12CameraPluginE when creating camera plugin

I am trying to create a camera plugin in gazebo 1.0.1. I am using Ubuntu 12.04 on VMWare (MacOS Lion).
I don't know if I did all the steps in the correct way, so let me summarize:

I installed fuerte using the official instructions. I then followed both the instructions on ROS and Gazebo webpage to create plugins. I had no problems in creating a simple helloworld plugin or a plugin to move a box.

I am referring to this tutorial about the creation of a camera.

I created a package using

roscreate-pkg camera_plugin gazebo roscpp std_msgs

then I copy-paste the suggested code in two different files put in src/ folder of my package. I edited CMakeLists.txt in order to compile the plugins:

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

rosbuild_init()

set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

rosbuild_add_library(CameraDump SHARED src/CameraDump.cpp)
target_link_libraries(CameraDumb ${GAZEBO_libraries})

rosbuild_add_library(CameraMove SHARED src/CameraMove.cpp)
target_link_libraries(CameraMove ${GAZEBO_libraries} CameraPlugin)`

I compiled the code using rosmake, then I edited the default empty.world (after creating a backup copy) in order to add my plugins. I copy-paste the world suggested by the tutorial, then I launched gazebo using

roslaunch gazebo_worlds empty_world.launch.

Gazebo starts but I get as error:

Error [Plugin.hh:100] Failed to load plugin /path/camera_plugin/lib/libCameraDump.so: /path/camera_plugin/lib/libCameraDump.so: undefined symbol: _ZTIN6gazebo12CameraPluginE

Any suggestion on what may be the cause of this error?

2013-10-08 17:28:17 -0500 received badge  Necromancer (source)
2013-03-17 22:47:04 -0500 received badge  Self-Learner (source)
2013-03-17 19:46:19 -0500 marked best answer Unable to establish a connection using rosbridge

Hi, I'm trying to use rosjs in order to establish a connection with a rosbridge server (and do some simple task like subscribe a topic), with no luck.

Here's my test.html:

<!DOCTYPE html>
<html>
<head>
<title>rosjs Publisher Subscriber Tutorial</title>
<script type="text/javascript" src="http://brown-ros-pkg.googlecode.com/svn/tags/brown-ros-pkg/rosbridge/ros.js"></script>

<script>
function log(msg) {$('#log').append(msg.toString() + '<br>');  }

function start() {

    document.write("Start() called<br>");
    log("Connecting to rosbridge.");
    var node = new ros.Connection("ws://mymachinename:9090");

    node.setOnClose(function(e) {
        document.write("Disconnected or can't connect");
        log("Disconnected or Can't Connect.");
    });
    node.setOnError(function(e) {
        document.write("Unknown error");
        log("Unknown error!");
    });
    node.setOnOpen(function(e) {
        document.write("Connection established");
        log("Connection to rosbridge established.");

   //publish the time every 1000 miliseconds

    setInterval(function(){
        var currentTime=new Date();
        var hours=currentTime.getHours();
        var minutes=currentTime.getMinutes();
        var seconds=currentTime.getSeconds();
        var timeMessage="It is now "+ hours+ ":" + minutes + ":"+ seconds ;
        node.publish('/talker', 'std_msgs/String', ros.json({data: timeMessage}));
    }, 1000);

    node.subscribe('/talker', 'std_msgs/String', function(msg){        

        document.write("Subscribed");
        log(msg.data) 
    });
});
}

</script></head>
<body onload="start()" style="margin:0;padding:0;background-color:white;overflow:hidden">
<div style="font-family: fixed-width; font-size: small;" id="log"></div>

</body>
</html>

I'm launching both roscore and

rosrun rosbridge_server rosbridge.py

The problem is that on the browser I only see "Start() called", and nothing else. I don't see error messages on the server, but only

Rosbridge server started on port 9090

Any suggestion on what I'm doing wrong? I'm using fuerte and Ubuntu 12.04.

EDIT:

Since I mostly copy-pasted the code from the rosjs tutorial, can anybody tell me how can I notify the error?

2013-03-05 08:12:37 -0500 received badge  Notable Question (source)
2013-03-05 08:12:37 -0500 received badge  Famous Question (source)
2013-03-05 08:12:37 -0500 received badge  Popular Question (source)
2013-02-17 21:14:54 -0500 received badge  Famous Question (source)
2012-12-18 23:42:37 -0500 received badge  Famous Question (source)
2012-12-13 00:49:48 -0500 commented question How to find the problem of kinect when rostopic echo get nothing

Does rostopic echo /camera/depth/points print anything?