Skip to content

Instantly share code, notes, and snippets.

View plinioMoreno's full-sized avatar

Plinio Moreno plinioMoreno

View GitHub Profile
@plinioMoreno
plinioMoreno / hello_world_reader.cpp
Created October 8, 2015 17:47
YARP code that reads the hello world string from ROS publisher
// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
#include <stdio.h>
#include <yarp/os/all.h>
using namespace yarp::os;
int main(int argc, char *argv[]) {
Network yarp;
//Node node("/yarp/hello_world_listener");
BufferedPort<Bottle> port;
port.setReadOnly();
@plinioMoreno
plinioMoreno / ros_hello_world_publisher.py
Created October 8, 2015 17:44
ROS hello world publisher in python
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
pub = rospy.Publisher('topic_name', String, queue_size=10)
rospy.init_node('node_name')
r = rospy.Rate(10) # 10hz
while not rospy.is_shutdown():
pub.publish("hello world")
r.sleep()