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

crpizarr's profile - activity

2023-05-26 13:45:02 -0500 received badge  Nice Question (source)
2022-04-12 06:00:37 -0500 received badge  Great Question (source)
2021-10-22 11:10:11 -0500 received badge  Popular Question (source)
2021-10-22 11:10:11 -0500 received badge  Famous Question (source)
2021-10-22 11:10:11 -0500 received badge  Notable Question (source)
2021-02-22 08:27:23 -0500 received badge  Good Question (source)
2021-01-18 15:38:45 -0500 received badge  Good Question (source)
2020-04-04 03:05:56 -0500 received badge  Nice Question (source)
2019-06-24 16:27:08 -0500 received badge  Good Question (source)
2019-04-25 08:01:33 -0500 received badge  Nice Question (source)
2018-12-05 13:38:05 -0500 received badge  Great Question (source)
2017-07-01 16:33:59 -0500 marked best answer Rosparam load without overriding

Is there a way to load a .yaml file without overriding parameters? I have two independent .launch files that depend on the same .yaml file storing the configuration of the package, but one section of the package (corresponding to a one .launch file) might change the parameters (without dumping into the .yaml file), and the other section needs to get the newest parameters, which in this case would be those in the parameter server, not in the .yaml file.

Thanks in advance

2017-04-20 17:40:56 -0500 marked best answer Blocking service callbacks

Hello everyone. I have been doing experiments with ROS services and currently I have this:

"""services_node.py"""
#!/usr/bin/env python

import time
import rospy
from beginner_tutorials.srv import * 

def handle_action_1(request):
    print "doing action 1"
    time.sleep(2)
    return Action1Response()

def handle_action_2(request):
    print "doing action 2"
    return Action2Response()

if __name__ == "__main__":
    rospy.init_node("services_node")
    action_1 = rospy.Service("action_1", Action1, handle_action_1)
    action_2 = rospy.Service("action_2", Action2, handle_action_2)
    rospy.spin()


"""caller_1.py"""
#!/usr/bin/env python

import rospy
from beginner_tutorials.srv import *

rospy.wait_for_service("action_2")
action_2 = rospy.ServiceProxy('action_2', Action2)
i = 0
while True:
    print "take %d" % i
    print "calling for action_2" 
    action_2()
    i = i + 1

"""caller_2.py"""
#!/usr/bin/env python

import rospy
from beginner_tutorials.srv import *

rospy.wait_for_service("action_1")
action_1 = rospy.ServiceProxy('action_1', Action1)
i = 0
while True:
    print "take %d" % i
    print "calling for action_1" 
    action_1()
    i = i + 1

This nodes are basically a node that publishes two services, called "action_1" and "action_2", and two nodes that constantly call those services. By the way, the Action1 and Action2 services are empty services, with just a "---" in the .srv files.

The problem I see is that when I run these nodes, the caller_1 node shows the "calling for action_1" every two seconds, which makes sense for me. But, as far as I know, I would expect the caller_2 node to print its text every two seconds, since the services_node is "busy" with the callback for action_1. But what I see is that the caller_2 node works as if was alone, without waiting for the response.

Can you explain this please? I thought service callbacks were blocking, since it's just one node who is answering those services, but it seems the callbacks are not blocking in this case.

2016-06-28 22:29:58 -0500 marked best answer roscpp roslaunch get arguments

I have a launcher with some arguments, so I expect to launch it like this

roslaunch my_package my_launcher.launch my_argument:=some_value

Is there a way to get the value of "my_argument" ("some_value" as a string or number if it's a number) from the node code?

I want to do something like this:

std::string my_value = ros::launch::?????::get_arg("my_argument");

Thanks in advance

2016-05-08 15:21:46 -0500 marked best answer Rviz colorbar

I have a cloud of PointXYZI and I'm visualising them in Rviz. With the rainbow transform for intensities (you know, high values are "blue" and low values are "red"), is there a way to get a colorbar to know which colors match which values?

2015-10-23 04:40:30 -0500 received badge  Notable Question (source)
2015-10-23 04:40:30 -0500 received badge  Famous Question (source)
2015-07-14 06:54:46 -0500 received badge  Good Question (source)
2015-05-19 17:39:37 -0500 received badge  Nice Question (source)
2015-05-04 03:01:23 -0500 marked best answer TCP socket with ROS

Hi.I have to make a node that publishes a service and its callback is a function that communicates with an embedded device (non running ROS) through TCP, send some bytes and close the connection. I want to make the node in C++, so I' have to write the code to create and use a socket. But, as far as I know, ROS uses TCP to communicate nodes, so:

Is there a way to use ROS functionalities to communicate through TCP, instead of code my own sockets?

Thanks

2015-03-20 10:39:59 -0500 received badge  Nice Question (source)
2015-03-10 10:18:34 -0500 received badge  Famous Question (source)
2014-11-25 18:15:47 -0500 marked best answer PCL Header timestamp

The pcl_ros tutorial example doesn't work:

#include <ros/ros.h>
#include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h>

typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;

int main(int argc, char** argv)
{
    ros::init (argc, argv, "pub_pcl");
    ros::NodeHandle nh;
    ros::Publisher pub = nh.advertise<PointCloud> ("points2", 1);

    PointCloud::Ptr msg (new PointCloud);
    msg->header.frame_id = "some_tf_frame";
    msg->height = msg->width = 1;
    msg->points.push_back (pcl::PointXYZ(1.0, 2.0, 3.0));

    ros::Rate loop_rate(4);
    while (nh.ok())
    {
        msg->header.stamp = ros::Time::now ();
        pub.publish (msg);
        ros::spinOnce ();
        loop_rate.sleep ();
   } 
}

The compiler complains with the following:

error: no se puede convertir ‘ros::Time’ a ‘uint64_t {aka long unsigned int}’ en la asignación (it's in Spanish, I don't know how to change my compiler language)

which is something like:

error: 'ros::Time' cannot be converted to 'uint64_t {aka long unsigned int}' in assignment

Has somebody else faced this problem? I am running ROS Hydro, on Ubuntu 12.04.

Thanks

2014-11-17 11:31:26 -0500 received badge  Notable Question (source)
2014-11-17 11:31:26 -0500 received badge  Famous Question (source)
2014-11-15 11:22:24 -0500 marked best answer read topic without callback

Is there a way to read the last message of a topic wihout using a callback? I mean, the tutorials teach to read a topic assigning a callback in a node, so that whenever a topic updates, the callback is executed. I want to read a topic when the user clicks a button, just once, something like this:

read_topic("/my_topic")

that returns the current data in the topic.

Thanks

2014-11-15 11:22:14 -0500 received badge  Famous Question (source)
2014-10-06 12:09:39 -0500 received badge  Famous Question (source)
2014-09-25 16:47:08 -0500 received badge  Popular Question (source)