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

Alkaros's profile - activity

2022-03-14 10:52:29 -0500 received badge  Nice Answer (source)
2016-01-09 18:45:18 -0500 received badge  Taxonomist
2014-10-25 23:04:50 -0500 received badge  Enlightened (source)
2014-05-25 18:20:48 -0500 received badge  Good Answer (source)
2014-03-25 22:36:13 -0500 received badge  Famous Question (source)
2014-01-28 17:32:11 -0500 marked best answer Turtlebot Simulator Crashing when trying to subscribe to camera topics

Ubuntu 13.04 and Gazebo 1.9.1 - Hydro

This was all working this morning but I did touch something I shouldn't have so I had to reinstall a lot of things. It's been a rough day

I auto removed all of the gazebo and turtlebot_simulator stuff and reinstalled them. This issue is also mirrored on my laptop.

Note: Keyboard teleop Control still works. Rviz still works with point cloud data. Trying to get an image causes the crash also.

It loads in gazebo properly but trying to subscribe to the camera topics at all, ie typing:

rostopic echo /camera/depth/raw_image

causes this error

gzserver: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: boost::shared_ptr<T>::reference boost::shared_ptr<T>::operator*() const [with T = boost::mutex; boost::shared_ptr<T>::reference = boost::mutex&]: Assertion `px != 0' failed.
Aborted (core dumped)
[gazebo-2] process has died [pid 21077, exit code 134, cmd /opt/ros/hydro/lib/gazebo_ros/gzserver /opt/ros/hydro/share/turtlebot_gazebo/worlds/empty.world __name:=gazebo __log:=/home/thesis/.ros/log/142f71ec-3553-11e3-a33b-0026b97f1590/gazebo-2.log].
log file: /home/thesis/.ros/log/142f71ec-3553-11e3-a33b-0026b97f1590/gazebo-2*.log

This is from the master.log. I'm not sure if it is relevent

    [rosmaster.master][INFO] 2013-10-15 14:33:44,077: publisherUpdate[/laserscan_nodelet_manager/bond] -> <a href="http://alex-zoom:58622/">http://alex-zoom:58622/</a>
[rosmaster.threadpool][ERROR] 2013-10-15 14:33:44,078: Traceback (most recent call last):
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rosmaster/threadpool.py", line 218, in run
    result = cmd(*args)
  File "/opt/ros/hydro/lib/python2.7/dist-packages/rosmaster/master_api.py", line 189, in publisher_update_task
    xmlrpcapi(api).publisherUpdate('/master', topic, pub_uris)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1297, in single_request
    return self.parse_response(response)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1473, in parse_response
    return u.close()
  File "/usr/lib/python2.7/xmlrpclib.py", line 793, in close
    raise Fault(**self._stack[0])
Fault: <Fault -1: 'publisherUpdate: unknown method name'>
2014-01-28 17:32:08 -0500 marked best answer Using if statements with std_msgs::String::ConstPtr

I have a node that is getting action calls from another node. Once it gets the action, I want to call a specific function but the if statement doesn't ever return true.

How can I get an if statement to work with a std_msgs string?

void chattersCallback(const std_msgs::String::ConstPtr& msg)
{
  ROS_INFO("I heard: %s", msg->data.c_str());
  if ((msg->data.c_str()) == "Listen") {sendStopAction();}
}

The terminal shows

[ INFO] [1381550860.740367371]: I heard: Listen

But the If statement does not return true. There is another print statement in the sendStopAction() function

2014-01-28 17:32:08 -0500 marked best answer How to make a c++ node Listen and Publish

I feel like this should be a simple problem.

The listening callback function is working and it is printing in terminal but the publishing doesn't seem to be working. The node shows up in rostopic list but it does not echo anything.

The script is getting an observation from an APPL node and gets an action back. I then want to pass the action to the action node.

Ideally, I want to get something like this working as the published attribute:

void sendAction(int action) 
{
    printf("SENDING ACTION\n");
    ros::NodeHandle nh;
    ros::Publisher vel_pub = nh.advertise<geometry_msgs::Twist>("cmd_vel", 1);
    geometry_msgs::Twist vel;
    vel.angular.z = 0;
    vel.linear.x = 1;
    vel_pub.publish(vel); 
}

This is the whole script at the moment

using namespace std;

// Messege recieved callback
void chatterCallback(const std_msgs::String::ConstPtr& msg)
{ 
    // Variables
    std_msgs::String actionstr;
    std::stringstream ss;

    // Set up
    ros::NodeHandle n;

    // Publish and advertise
    ros::Publisher chatter_pubs = n.advertise<std_msgs::String>("actionstr", 1000);
    ros::Rate loop_rate(10);

    // APPL NODE SHIZ
    appl::appl_request srv;
    ros::ServiceClient client = n.serviceClient<appl::appl_request>("appl_request");

    //Send to POMDP Node
    srv.request.cmd=2;
    srv.request.obs=msg->data.c_str();
    client.call(srv);
    int action=srv.response.action;

    // Get action string
    if (action == 0) {ss << "Listen";}
    if (action == 1) {ss << "OpenRight";}
    if (action == 2) {ss << "OpenLeft";}

    // Publish String
    actionstr.data = ss.str();

    chatter_pubs.publish(actionstr);

    printf("Sent\n");

    printf("Obs: %s  Action: %d - %s\n", msg->data.c_str(), action, actionstr.data.c_str());    

}

    /* ------------------------------------------------ */
    /* ---------------------******--------------------- */
    /* ---------------------*MAIN*--------------------- */
    /* ---------------------******--------------------- */
    /* ------------------------------------------------ */

int main(int argc, char **argv)
{ 
    ros::init(argc, argv, "listener");
    ros::NodeHandle n;

    // Set to Appl client
    ros::ServiceClient client = n.serviceClient<appl::appl_request>("appl_request");

    srand((unsigned)time(0));
    int tiger;//0=left 1=right
    tiger=rand()%2;

    // Reset Appl Controller.
    appl::appl_request srv;
    srv.request.cmd=1;  //reset the controller first
    client.call(srv);
    int action=srv.response.action;
    ROS_INFO("I Listen");
    ros::Subscriber sub = n.subscribe("chatter", 1000, chatterCallback);
    ros::spin();

  return 0;
}
2014-01-28 17:32:06 -0500 marked best answer Storing kinect depth data from turtlebot in an array.

I'm trying to write a ros node that subscribes to the turtlebot kinect data streams and can retrieve a distance at a specific point in the image (for starters, it will just be the centre centre point) I've tried following the ros_bridge tutorials but I get errors when compiling and I'm not sure that that is the best route to take.

If it helps, the whole process I'm trying is to set up the turtlebot, have it decide on it target, get the distance to that target. Pass the observation into the pomdp node, and get an action out.

So far the pomdp node and action's are working, I just cant get data that I can manipulate out of the kinect depth topic.

2014-01-28 17:31:52 -0500 marked best answer Turtlebot depth image not displaying with Image_view with gazebo

Hey, I'm using the turtlebot_simulator package to simulate in gazebo.

Ubuntu 13.04 - 32bit

Ros Hydro

Turtlebot-apps v2.2.0

Gazebo v1.9

rosrun image_view image_view image:=/camera/depth/image_raw

Using the image_view on the depth image returns a blank gray window. Where as using the same command on the RGB stream works perfectly. Here's a screen shot of whats happening so save myself trying to explain it.

Screenshot

Any ideas why this would occur? The depth data is displayed correctly in rviz.


Rostopic Hz /camera/depth/image_raw
subscribed to [/camera/depth/image_raw]
average rate: 2.609
    min: 0.360s max: 0.420s std dev: 0.02625s window: 4
average rate: 2.765
    min: 0.330s max: 0.420s std dev: 0.03023s window: 7
average rate: 2.769
    min: 0.330s max: 0.420s std dev: 0.02514s window: 10

and

Rostopic info /camera/depth/image_raw
Type: sensor_msgs/Image

Publishers: 
 * /gazebo (<a href="http://Thesis-4740111:57881/">http://Thesis-4740111:57881/</a>)

Subscribers: None

After running those commands, the image_view started working on the depth. I guess magic will explain it.

Something must have changed over the last few days.

2014-01-28 17:31:49 -0500 marked best answer Getting Raw Data from Turtlebot Simulator

Currently running the newest version of turtlebot_simultor and everything is running very well on hydro.

I'm working on a project where I'm trying to integrate POMDP with the turtlebot. I'm trying to get the simmulation working with POMDP first before moving to the actual turtlebot while I'm still testing the Policy and Model.

How can I get raw data from the kinect sensor in the simulation. I've seen the point cloud map it can create in rviz which is useful for one part of the project but I currently need a way to extract a depth value for following a target at a set distance. I'd like to write a small script that just listens to the data being output from the sensor node and passes the important data into the policy and then send the move command somehow to the turtlebot.

Eventually this will be used for a tracking and facial recognition project. The aim is to see how the turtlebot will act while following a target with uncertainty. Depth will be important for following from a certain distance (Which is the first goal) and then after that will be the bot moving to see a face that will be run through a facial recognition program. This last goal will require an image output to be scanned.

Does anyone know of a way to achieve something like this? Some form of automated control?

Thanks.

2014-01-28 17:31:44 -0500 marked best answer Turtlebot Simulator Package and Rviz Crashing.

Currently Running Hydro and the newest version of the turtlebot_simulator Package. Previously teleop commands were not sending but that has been fixed in a newer version I think.

Currently having issues with RViz. It worked prior to the update, now it crashes when point cloud or any sensor is activated. Also, it has never worked with "image"

This was the crash in terminal:

Registered event listener change listener:  true 
[rviz-1] process has died [pid 3635, exit code -11, cmd /opt/ros/hydro/lib/rviz/rviz -d /opt/ros/hydro/share/turtlebot_rviz_launchers/rviz/robot.rviz __name:=rviz __log:=/home/thesis/.ros/log/c61c9da8-1447-11e3-90c8-0026b97f1590/rviz-1.log].
log file: /home/thesis/.ros/log/c61c9da8-1447-11e3-90c8-0026b97f1590/rviz-1*.log

Any ideas?

2014-01-28 17:31:38 -0500 marked best answer Teleop control not working in Turtlebot Simulator package and Gazebo

currently following the tutorial @ http:// www.ros.org/wiki/turtlebot_simulator/Tutorials/hydro/Explore%20the%20Gazebo%20world

Everything else seems to work fine. The model loads into gazebo and the pointclooud image can be seen in Rviz. But I cannot control the turtlebot using the teleop keyboard configuration.

I'm using the newest Gazebo(1.9) and ros Hydro is installed.

If I try to use the $ roslaunch kobuki_keyop keyop.launch command it tells me Keyop can not connect. I'm not sure if they've started on different servers and are unable to communicate.

2014-01-15 04:21:56 -0500 received badge  Famous Question (source)
2013-11-26 12:05:25 -0500 received badge  Notable Question (source)
2013-11-26 12:05:25 -0500 received badge  Popular Question (source)
2013-11-22 19:48:06 -0500 received badge  Nice Answer (source)
2013-11-19 13:14:16 -0500 received badge  Famous Question (source)
2013-11-19 07:03:38 -0500 received badge  Notable Question (source)
2013-11-19 07:03:38 -0500 received badge  Famous Question (source)
2013-11-19 07:03:38 -0500 received badge  Popular Question (source)
2013-11-16 19:42:21 -0500 received badge  Notable Question (source)
2013-11-16 09:44:44 -0500 received badge  Notable Question (source)
2013-11-12 02:15:45 -0500 marked best answer Simulating a person for use with Turtlebot_simulator and turtlebot_follower

Running Ros Hydro and Gazebo 1.9

How would I go about creating a human model or even just something similar that would allow the follower package to work effectively.

I just need to have marginal control over the path the simulated human takes, something like, walk in a square over and over again.

Thanks.

2013-11-10 11:02:04 -0500 commented answer Teleop control not working in Turtlebot Simulator package and Gazebo

You'll also need to install ros-hydro-turtlebot-apps. http://wiki.ros.org/turtlebot_simulator/Tutorials/hydro/Explore%20the%20Gazebo%20world. You can see thee published topics using "rostopic list". Also for the maze. http://gazebosim.org/wiki/Building_Editor

2013-11-08 05:15:00 -0500 received badge  Famous Question (source)
2013-10-28 22:43:57 -0500 received badge  Famous Question (source)