Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelchang committed Mar 10, 2016
1 parent 71da966 commit cba1967
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.3)
project(roscloud_client)
project(canopy_client)

find_package(catkin REQUIRED COMPONENTS
rospy
Expand Down
12 changes: 6 additions & 6 deletions launch/example.launch
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<?xml version="1.0"?>
<launch>
<arg name="host" default="localhost" />
<arg name="port" default="50000"/>
<node pkg="roscloud_client" type="client_node.py" name="foo_client_node" output="screen">
<arg name="host" default="raphaelchang.com" />
<arg name="port" default="8080"/>
<node pkg="canopy_client" type="client_node.py" name="foo_client_node" output="screen">
<param name="name" value="foo"/>
<param name="host" value="$(arg host)"/>
<param name="port" value="$(arg port)"/>
<param name="private_key" value="MIICXAIBAAKBgQCTUQ49FJUCVvU5tIag" />
<param name="description" value="foo robot" />
</node>

<node pkg="roscloud_client" type="client_node.py" name="bar_client_node" output="screen">
<node pkg="canopy_client" type="client_node.py" name="bar_client_node" output="screen">
<param name="name" value="bar"/>
<param name="host" value="$(arg host)"/>
<param name="port" value="$(arg port)"/>
<param name="private_key" value="MIICXAIBAAKBgQCTUQ49FJUCVvU5tIag" />
<param name="description" value="bar robot" />
</node>

<node pkg="roscloud_client" type="client_node.py" name="baz_client_node" output="screen">
<node pkg="canopy_client" type="client_node.py" name="baz_client_node" output="screen">
<param name="name" value="baz"/>
<param name="host" value="$(arg host)"/>
<param name="port" value="$(arg port)"/>
<param name="private_key" value="MIICXAIBAAKBgQCTUQ49FJUCVvU5tIag" />
<param name="description" value="baz robot" />
</node>

<node pkg="roscloud_client" type="client_node.py" name="qux_client_node" output="screen">
<node pkg="canopy_client" type="client_node.py" name="qux_client_node" output="screen">
<param name="name" value="qux"/>
<param name="host" value="$(arg host)"/>
<param name="port" value="$(arg port)"/>
Expand Down
2 changes: 1 addition & 1 deletion launch/video_chat_demo.launch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<launch>
<node pkg="roscloud_client" type="client_node.py" name="raphael_client_node" output="screen">
<node pkg="canopy_client" type="client_node.py" name="raphael_client_node" output="screen">
<param name="name" value="raphael"/>
<param name="host" value="wallar.me"/>
<param name="port" value="8080"/>
Expand Down
6 changes: 3 additions & 3 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?xml version="1.0"?>
<package>
<name>roscloud_client</name>
<name>canopy_client</name>
<version>0.0.1</version>
<description>ROS Cloud Robotics Framework</description>
<description>Canopy - The ROS Cloud Robotics Framework</description>
<maintainer email="[email protected]">Alex Wallar</maintainer>
<license>GPLv3</license>
<url type="website">http://github.com/roscloud/roscloud_client</url>
<url type="website">http://github.com/canopy-ros/canopy_client</url>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>rospy</build_depend>
<build_depend>std_msgs</build_depend>
Expand Down
16 changes: 10 additions & 6 deletions src/client_node.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# Defines the ROSCloudNode class.
# Defines the CanopyClientNode class.

import rospy
import time
Expand All @@ -9,12 +9,12 @@
import threading


NODE_NAME = "roscloud_client"
NODE_NAME = "canopy_client"

# The ROS node object for the ROSCloud client.
# The ROS node object for the Canopy client.
# Manages all connections and subscribing.
# One instance per client node.
class ROSCloudNode(object):
class CanopyClientNode(object):

def __init__(self, host, port, name, broadcasting, private_key, description):
self.host = host
Expand All @@ -33,12 +33,16 @@ def __init__(self, host, port, name, broadcasting, private_key, description):
# Creates all connections and subscribers and starts them.
# Runs a loop that checks for received messages.
def run(self):
if self.name.startswith("canopy_leaflet_"):
rospy.logerr("{}: names starting with 'canopy_leaflet_'"
" are reserved".format(self.name))
return
for topic, msg_type, trusted in self.broadcasting:
if topic[0] != "/":
topic = "/" + topic
self.create_subscriber(topic, msg_type, trusted)
if topic == "/receiving":
rospy.logerror("{}: topic name 'receiving' is reserved".format(
rospy.logerr("{}: topic name 'receiving' is reserved".format(
self.name))
continue
self.conn[topic] = Connection(host, port, "{}{}".format(
Expand Down Expand Up @@ -114,6 +118,6 @@ def descriptionSend(self):
private_key = rospy.get_param("~private_key")
description = rospy.get_param("~description")
broadcasting = zip(topics, types, trusted)
rcn = ROSCloudNode(host, port, name, broadcasting, private_key,
rcn = CanopyClientNode(host, port, name, broadcasting, private_key,
description)
rcn.run()

0 comments on commit cba1967

Please sign in to comment.