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

skr_robo's profile - activity

2022-11-11 00:19:26 -0500 received badge  Famous Question (source)
2022-05-11 15:42:59 -0500 received badge  Guru (source)
2022-05-11 15:42:59 -0500 received badge  Great Answer (source)
2021-05-06 08:13:31 -0500 received badge  Famous Question (source)
2020-05-30 13:50:37 -0500 received badge  Famous Question (source)
2020-02-24 03:16:45 -0500 received badge  Notable Question (source)
2019-12-10 08:06:45 -0500 marked best answer Publishing multiple variables using a single publisher

I have written a publisher to publish a float32 value to a topic depth_m. Now, I need to publish two more variables and they are of type int, not float. I would like all three of these variables to be published to the same topic. I am referring to the official tutorial). Do I just replace Float32 in the following lines with Int32 and add it to the existing publisher?

ros::Publisher depth_pub = pub_.advertise<std_msgs::Float32>("depth_m", 1000);
std_msgs::Float32 msg;

I believe I will have to edit msg to a different variable name msg1, msg2. According to me the whole thing will have the following lines:

ros::Publisher depth_pub = pub_.advertise<std_msgs::Float32>("depth_m", 1000);
ros::Publisher depth_pub2 = pub_.advertise<std_msgs::Int32>("depth_m", 1000);

std_msgs::Float32 msg;
std_msgs::Int32 msg1;
std_msgs::Int32 msg2;    

msg.data=depth;
msg1.data=var1;
msg2.data=var2;

depth_pub.publish(msg); 
depth_pub2.publish(msg1);
depth_pub2.publish(msg2);

Is this the right strategy? If do this, will the whole thing act as a single message or multiple messages? Can I avoid two advertise lines by using just std_msgs instead of std_msgs::Float32?

2019-10-28 16:31:31 -0500 marked best answer Feasibility of using Docker to isolate ROS and other tools in Robotics

I am very new to Docker and I want to use it to isolate ROS (Melodic), OpenCV and Deep Learning libraries. I have Ubuntu 18.04 LTS running with CUDA, Eclipse, cmake and a few other basic tools installed. Ideally, I would like three isolated entities, one each for ROS, OpenCV and Deep Learning Libraries. These three isolated entities run on top of the image of existing Ubuntu platform. When I install a new package/ module related to ROS, I don't want it to cause any conflicts with a package used by OpenCV or Deep Learning Libraries. At the same time ROS should be able to use OpenCV or Deep Learning Libraries as well as the common resources in the Ubuntu platform. I have already read this, but it only deals with ROS, not the interaction between different software packages.

1) Is such a system possible using Docker?

2) Can anyone provide some guidance regarding a roadmap towards such an implementation?

2019-09-13 16:10:11 -0500 received badge  Famous Question (source)
2018-11-14 18:49:19 -0500 received badge  Notable Question (source)
2018-11-14 09:11:52 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

I understand the point you are trying to make. However, I would like to do some more research before dismissing the idea

2018-11-14 09:00:10 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

In the scenario you mentioned with two computers, once the setup is completed, can't the system with ROS talk to the com

2018-11-14 08:59:02 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

In the scenario you mentioned with two computers, once the setup is completed, can't the system with ROS talk to the com

2018-11-14 08:56:42 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

When I use the term 'isolated', I mean isolated enough to handle the issues mentioned in first few paragraphs [Are you,

2018-11-14 08:44:07 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

But cannot it not be designed in such a way that ROS and OpenCV have their own separate container? Something similar to

2018-11-14 08:42:44 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

But cannot it not be designed in such a way that ROS and OpenCV have their own separate container within a single image?

2018-11-14 08:42:09 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

But cannot it not be designed in such a way that ROS and OpenCV have their own separate container within a single image?

2018-11-14 08:02:05 -0500 commented question Feasibility of using Docker to isolate ROS and other tools in Robotics

@gvdhoom Based on the research I have done so far, I believe the three isolated entities I have mentioned in the questio

2018-11-14 00:06:18 -0500 received badge  Popular Question (source)
2018-11-14 00:04:59 -0500 received badge  Famous Question (source)
2018-11-13 14:55:19 -0500 asked a question Feasibility of using Docker to isolate ROS and other tools in Robotics

Feasibility of using Docker to isolate ROS and other tools in Robotics I am very new to Docker and I want to use it to i

2018-10-22 12:58:22 -0500 received badge  Famous Question (source)
2018-09-19 04:31:18 -0500 marked best answer Constructing a float32 value from four uint8 bytes

I am trying to read depth values from the topic /camera/depth/image_rect_color. The message is of the type sensor_msgs/Image and prints out 8 bit data (uint8) as elements of an image array. Since the image is encoded as 32FC1, I need to combine four of these elements to obtain depth information of a single pixel. A stack overflow answer contains the following code:

float f;
uchar b[] = {b3, b2, b1, b0};
memcpy(&f, &b, sizeof(f));
return f;

Is this the right approach to construct a float32 value from 4 bytes of uint8 values, without any data loss ?

2018-09-19 04:21:43 -0500 marked best answer Running roscore and nodes in separate computers

Due to limited storage space, I would like to run my roscore and certain important packages in one system (A Jetson TX1 running ros indigo on ubuntu 14.04) and my subscriber packages in another. Both these systems are on the same router. I believe that Jetson is to be set up as a master/server and the other system should be a client. But how can I set these up?

2018-09-05 09:28:27 -0500 received badge  Enlightened (source)
2018-09-05 09:28:27 -0500 received badge  Good Answer (source)
2018-06-18 07:10:34 -0500 received badge  Notable Question (source)
2018-05-31 13:15:44 -0500 received badge  Famous Question (source)
2018-05-01 12:53:49 -0500 received badge  Famous Question (source)
2018-04-04 05:10:02 -0500 received badge  Notable Question (source)
2018-04-04 05:10:02 -0500 received badge  Famous Question (source)
2018-03-21 00:23:12 -0500 received badge  Nice Answer (source)
2017-10-15 13:05:21 -0500 received badge  Popular Question (source)
2017-08-03 10:35:12 -0500 marked best answer ROS_INFO error in the subscriber package

Hello, I am trying to build a subscriber package to listen to tf_static. Here is the subscriber code:

//#include <iostream>
#include "ros/ros.h"
//#include "std_msgs/String.h"
#include "tf2_msgs/TFMessage.h"
#include "geometry_msgs/TransformStamped.h"
#include "geometry_msgs/Transform.h"
#include "geometry_msgs/Vector3.h"

//using namespace std;

    void tfCallback(const tf2_msgs::TFMessage::ConstPtr& msg)
    {
        ROS_INFO("I heard: [%f]", msg->transforms.transform.translation.x);
}
int main(int argc, char **argv)
{
    //cout << "Hello world!" << endl;
    ros::init(argc, argv, "tf_subscriber_node");
    ros::NodeHandle ntf;
    ros::Subscriber sub = ntf.subscribe("/tf_static",1000, tfCallback);
    ros::spin ();
    return 0;
}

I am receiving the following error:

src/tf_subscriber_node.cpp:13:47: error: 'const _transforms_type' has no member named 'transform' ROS_INFO("I heard: [%f]", msg->transforms.transform.translation.x);

I believe the error could be due to the const keyword. Or am I doing anything wrong in the part:

msg->transforms.transform.translation.x

Can anyone kindly guide on how to fix this?

2017-07-24 04:47:03 -0500 received badge  Famous Question (source)
2017-06-08 15:51:08 -0500 received badge  Popular Question (source)
2017-06-08 15:48:51 -0500 received badge  Notable Question (source)
2017-06-08 15:48:51 -0500 received badge  Popular Question (source)
2017-06-08 15:48:32 -0500 received badge  Famous Question (source)
2017-06-05 12:20:41 -0500 received badge  Notable Question (source)
2017-06-05 12:20:41 -0500 received badge  Famous Question (source)
2017-05-18 03:38:45 -0500 received badge  Popular Question (source)
2017-05-18 03:38:45 -0500 received badge  Notable Question (source)
2017-04-02 10:23:56 -0500 received badge  Famous Question (source)
2017-03-27 07:26:29 -0500 received badge  Famous Question (source)
2017-03-16 02:20:08 -0500 received badge  Taxonomist
2017-02-28 04:06:06 -0500 received badge  Famous Question (source)
2017-02-21 15:30:39 -0500 received badge  Famous Question (source)
2017-02-13 04:48:33 -0500 received badge  Famous Question (source)