Ask Your Question

aks's profile - activity

2019-10-11 11:50:59 -0500 received badge  Famous Question (source)
2019-10-11 05:01:41 -0500 received badge  Notable Question (source)
2019-10-10 13:20:30 -0500 marked best answer Is it possible with ROS2 to send and recieve UDP messages to a certain IP address ?

Would it be possible to send and recieve ROS2 messages to a certain ip address ?

e.g. I have a ROS2 listener node which can subscribe messages from a certain IP address and then do some calculations and publish the message to the same IP address.



I have attached a picture to make it understand better.image description Basically it is ROS2 instead of ROS. There is one node in ROS2 performing some calculations with the help of the values coming from another function that is my own simulation tool. Now i want to exchange data between ROS2 and the simulation tool through DDS. In the tool there is a possiblity to integrate any external tool (in this case ROS2) through the python code. What is the best aproach to do this ?

2019-10-10 12:13:50 -0500 received badge  Famous Question (source)
2019-10-07 20:59:13 -0500 received badge  Famous Question (source)
2019-09-23 12:46:38 -0500 received badge  Popular Question (source)
2019-09-19 07:07:30 -0500 received badge  Famous Question (source)
2019-09-18 11:46:39 -0500 edited question Subscribing to /camera/image/compressed

Subscribing to /camera/image/compressed I am publishing a video through rosbridge using roslibpy in a compressed format.

2019-09-18 11:02:35 -0500 edited question Subscribing to /camera/image/compressed

Subscribing to /camera/image/compressed I am publishing a video through rosbridge using roslibpy in a compressed format.

2019-09-18 10:49:17 -0500 edited question Subscribing to /camera/image/compressed

Subscribing to /camera/image/compressed I am publishing a video through rosbridge using roslibpy in a compressed format.

2019-09-18 10:48:56 -0500 edited question Subscribing to /camera/image/compressed

Subscribing to /camera/image/compressed I am publishing a video through rosbridge using roslibpy in a compressed format.

2019-09-18 10:48:31 -0500 asked a question Subscribing to /camera/image/compressed

Subscribing to /camera/image/compressed I am publishing a video through rosbridge using roslibpy in a compressed format.

2019-09-18 04:13:47 -0500 commented answer Transferring Images through rosbridge

@gonzalocasas thank you for this example. One question here... is it necessary to use the (sensor_msgs/CompressedImage)

2019-09-18 04:10:36 -0500 marked best answer Transferring Images through rosbridge

I am using the rosbridge websocket server to establish communication between ROS and an environment simulation tool. I can easily exchange scalar values like the object list and the control signals. Now I want to transfer the images from the camera of the environment simulation tool to ROS, also through the rosbridge.

Is there a small example ?

2019-09-18 02:16:17 -0500 marked best answer Difference in the delay time between ROS and ROS2 for RT applications ?

I know that ROS is made for Real Time (RT) applications but why ? This should obviously depend on the complexity of the application. Since ROS uses a MASTER as the name service, there has to be a certain delay in the signal exchange just for the 1st time but i guess once the publisher and subscriber nodes are connected, there should be a minimal delay. ROS2 doesnt have a MASTER as it uses a distributed discovery mechanism and thus the message exchange can start instantly.

Now my questions :

  1. Is this the only difference between the delay times in ROS and ROS2 ? What exactly is the time delay for a normal ROS application. Is it in a few milliseconds or some seconds or does it totally depend on the types of signals exchanged. What is the real-time factor ? can the delay be monitored ?
  2. Upto what frequencies can ROS handle signals ? 1-100Hz, or in the range of KHz or MHz ?

EDIT 1: Let us take a Simulation Example of a Vehicle. We have 3 nodes namely Driver, Engine and Drivetrain. Engine Supplies torque to the drivetrain and receives back the speed from the drivetrain and the control (i.e. how much torque is required and gear shifting) is done by the driver. Thus it is a closed loop where all the nodes need to exchange messages instantly.

If there is any delay in message exchange (beyond a tolerable), the behaviour of the car would totally change.

For this application, can I use a ROS system :

  1. Can I build all three nodes in ROS ? Be it on the same or different PC's.
  2. Lets say I build these 3 functions (instead) of nodes in different simulation tools (e.g. Simulink). Then can I use ROS as a message exchanging service between them ? Or is it possible only in ROS2 (through DDS).
  3. If yes, thn what would be the CPU load, delay times etc ?
  4. Which timestamps would be used by ROS ? How are the timestamps handled when different PC's are used ? Is it done by the Master ?

EDIT 2: For my application, i need to exchange messages every 1ms i,e, at a frequency of 1KHz.

I hope it is a bit clearer now ?

2019-09-10 16:34:10 -0500 marked best answer How to use timer callback in ROS?

I am working with ROS Kinetic. Like in ROS2, we can use a create_timer() function as described here.

Similarly I would want to use a similar functionality in rospy in ROS. Something that is mentioned here in point 3.

Can anyone give an example how to use it ?

I am trying something like this in my class constructor but it never enters the callback function :

class DemoNode():
    def __init__(self):
        print("entering constructor")
        #super().__init__('custom_talker') = rospy.Publisher('topic',customMessage, queue_size=10)
        self.counter = 1
        print("creating a publisher")
        self.timer = rospy.Timer(rospy.Duration(1), self.demo_callback)
        print("timer called")

    def demo_callback(self):
        print("entering callback")
        msg = DetectedObject()
        print("Reading the message correctly") = self.counter
        counter += 1
        rospy.loginfo("Publishing message {}".format(

if __name__ == '__main__':

    print("entering main")
        print("entering Try")
    except rospy.ROSInterruptException:
        print("exception thrown")

Is it correct ? The node is running but it never enters the callback function

Also, it is mentioned that this Timer is supported in ROS 1.5+ . What is exactly that ? Does Kinetic already fulfill this condition ?

2019-08-26 05:18:00 -0500 received badge  Famous Question (source)
2019-08-26 04:45:13 -0500 marked best answer How can I disable multicasting and enable unicasting in ROS2

I am integrating ROS2 with another native DDS based application, both located on different laptops but in the same network. My problem is that I cannot use multicasting due to certain limitations. So, I opted for unicasting for the discovery process. I configured the native DDS based application as unicast as explained here. But my ROS2 based machine still uses multicasting. It is obvious that once I find the ROS2 based machine through unicasting, both discover each other and the communication works in both direction. But how can i configure ROS2 to use unicasting ?

2019-08-26 04:45:13 -0500 received badge  Self-Learner (source)
2019-08-23 13:24:41 -0500 received badge  Famous Question (source)
2019-08-21 19:51:15 -0500 received badge  Notable Question (source)
2019-08-19 14:56:10 -0500 marked best answer How is the size of a string allocated in ROS2 idl ?

How is the size of a string dynamically allocated while converting msg to idl. Is there a possibility to limit this size ?

2019-08-19 14:55:59 -0500 marked best answer Maximum Limit of String in ROS2

I am currently interfacing ROS2 with native RTI DDS Connext through RTI Connector for python.

In my ROS2 node, I have a custom message type which uses header messages from std_msgs. Now the header has a member string frame_id_. When the idl is generated for this msg, the size of the string is allocated as 2147483647 bytes. I can see this in the RTI Admin console. Now to match the Types in native DDS and ROS2, I need to give the same string size in RTI Connext through a QoS.xml file. But the problem is, this is too big a size for RTI to handle and the program crashes.

As a workaround, I modified the header_.idl in ROS2 lying in ROS2_base_ws/install/std_msgs/dds_connext/Header_.idl as string<255> frame_id_ i.e. I limited the max size of this string.

I recompiled it and ran the same node, but it always has the previous size i.e. 2147483647 bytes

Any other workaround ?

2019-07-31 05:03:53 -0500 received badge  Famous Question (source)
2019-07-26 11:20:42 -0500 received badge  Notable Question (source)
2019-07-26 11:20:42 -0500 received badge  Famous Question (source)
2019-07-25 16:05:30 -0500 marked best answer What is the difference between ROS and ROS2 ?

I know this question has been asked multiple times but i am still unclear about it.

ROS : As per my understanding, ROS is a sort of middleware i.e. between the application layer and the low layer kernels. We have a distributed discovery mechanism i.e. through nodes which registers themselves to the master and communicate with each other.

ROS2 : ROS2 is built up on ROS but uses DDS as a middleware (that means a middleware(ROS) using another middleware (DDS)) for centralized discovery.

My question is what is exactly the difference at this point i.e. distributed vs centralised - what does it mean and the use of middleware(why do we need DDS as a middleware (not the advantages of DDS)) . I know ROS2 is capable of many other things such as real time applications, more flexibility of languages but that does not interest me at the moment. I want to get this simple clarification in my head.

I am sorry for framing this question badly, i know i am myself confused.

2019-07-25 12:28:20 -0500 received badge  Famous Question (source)
2019-07-19 17:16:09 -0500 received badge  Famous Question (source)
2019-07-01 23:08:15 -0500 received badge  Notable Question (source)
2019-06-06 06:54:08 -0500 received badge  Famous Question (source)
2019-06-06 06:53:56 -0500 received badge  Notable Question (source)
2019-06-06 06:53:56 -0500 received badge  Popular Question (source)
2019-05-22 13:30:45 -0500 marked best answer What is the difference between local_setup.bash and setup.bash

In ROS2, we always source the local_setup.bash while working with the original parent workspace. Now lets say if i create an overlay workspace and create my own package, then while trying to build it, shall i source the local_setup.bash or the setup.bash.

My observation : if i start a new terminal and try these commands :

cd ~/ros2_overlay_ws/
source install/ local_setup.bash
ament build

This gives me an error stating ament: command not found

But if i source the setup.bash file instead, the build is successfull. wehereas i thought local_setup.bash file is used for sourcing the current variables to the current path. So it sould have built with the local_setup.bash Could anyone please clear out the differences ?

2019-05-20 01:25:45 -0500 marked best answer Do I need to call the batch file everytime i execute a ROS2 command in a new terminal

I am pretty new to ROS2. I have already installed ROS2 on Windows 10 as given in the installation guide. I get an error everytime i try to run a ROS2 command saying "ROS 2 is not recognised as an internal command". I know calling the batch file first resolves this error. But my question is do i need to call it everytime i write a command in the new terminal or have i done something wrong in the installation process ?

2019-05-20 01:15:16 -0500 marked best answer Can i install ROS2 on the same machine which alrerady has ROS installed ?

I worked with ROS for a couple of weeks and now need to upgrade to ROS2 due to its DDS feature. Although i know that ROS2 offers a bridge for ROS1 but just to be sure i want to ask if i can install ROS2 on the same machine as ROS or shall i create another VM to install ROS2 seperately ?

2019-05-20 01:15:01 -0500 marked best answer How to visualize/read string messages from Rosbag

I have received a bag file from a colleague and i need to analyze it. The file looks like this. image description

How can i visualize this in rviz ? What type shoul i select here instead of point cloud ? image description

2019-05-20 01:05:36 -0500 marked best answer How can i read messages from a ROSbag file ?

I have a bag file in which some are custom messages whereas others are string messages. How can i display the contents of the topics which have message of type strings (without converting it to a .csv file) ?image description

for example, From the attached image, how can i read the messages of the topic /pnc/relative_carstatus

2019-05-20 01:01:57 -0500 marked best answer Which memory is used while publishing messages in ROS ?

When messages are published i.e. fed into a queue, where are these messages stored ? Does it use the physical memory on the disc ? Is there also some memory sharing i.e. is the memory space split between Master, publishers and subscribers ? If yes, then where are the messages stored ? in Master's memory ?

2019-04-20 03:18:43 -0500 received badge  Famous Question (source)
2019-04-08 08:00:15 -0500 received badge  Famous Question (source)
2019-04-08 05:35:38 -0500 marked best answer How to decode binary data from a rosbag ?

When i try to echo the topics of a bag file, i get a message : data: !!binary | ChQJpiM5J7b11UESB2dhdGV3YXkYSRI7GAEt0YmNPjUAAAAARQAAAABNAAAAAF0AAAAAqAEAsAEA uAEAygEUCaYjOSe29dVBEgdjaGFzc2lzGAcamgEKGwl+jANaaLcaQRG3Y7kbwu1QQRlNc4QFq/qd vxIkCQAAAAAAAAAAEQAAAAAAAAAAGbZX/zsVBNw/IYPT7lNnxew/GhsJlaAsEDqx0T8R+pqtiJCs kzwZBQSdL5XVZj8iGwmW/f98qKacPxHERbyH1aKhvBlzAOArHy9+vyobCfeLggMmjbI8ER2XZG1t Jzg/GfBTn4g5Yn08IQAAAAAAABxA

This data seems to be binary encoded. The message type of this topic is string. How can i read this data ?

2019-04-05 04:38:32 -0500 received badge  Notable Question (source)