PhD Avoidance Syndrome

Most PhD students know that at some point, the dreaded PhD Avoidance Syndrome sets in. A few whatsapp and real-world conversations led to this:

Slightly Longer Version:


Reading Data on YARP with Python

YARP is another robot development platform, similar to ROS. I had to code up a simple data reader in Python (operating over YARP ports) and couldn’t find any good examples. After some experimenting, I found a solution that worked for me. The following is a simple code snippet for other YARP Python newbies:

class ExampleReader:
    def __init__(self):
        #create a new input port and open it
        self.in_port = yarp.BufferedPortBottle()"/example/data:i")

        #connect up the output port to our input port
        yarp.Network.connect("/example/data:o", "/example/data:i")


    def getData(self):
        #in this example, I assume the data is a single integer
        #we use read() where the parameter determines if it is 
        #blocking (True) or not.

        btl =

        my_data = btl.get(0).asInt()

        #if you have doubles, you can use asDouble()
        #or strings can be obtained using asString() 

        return my_data