Skip to content

Commit

Permalink
Merge pull request #112 from cpaxton/fix-travis-srv
Browse files Browse the repository at this point in the history
Fix travis srv
  • Loading branch information
cpaxton authored Nov 15, 2017
2 parents a771352 + 4b56af0 commit 30a7deb
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
import tf_conversions as tf_c
# Driver services for ur5
#from robotiq_c_model_control.srv import *
from std_srvs.srv import Empty
# from std_srvs.srv import Empty
import os

colors = ColorOptions().colors
# Node Wrappers -----------------------------------------------------------
Expand All @@ -28,7 +29,14 @@ def __init__(self):
self.title.setStyleSheet('background-color:'+colors['purple'].normal+';color:#ffffff')
self.wait_finish = NamedField('Wait', '','purple')
self.wait_finish.set_field('1')
self.note = NoteField('(1 = true, 0 = false)','purple')

self.message_contents = NamedField('message','', 'purple')
self.message_topic = NamedField('Rostopic','', 'purple')
self.message_topic.set_field('info')

self.note = NoteField('(1 = true, 0 = false)\nrostopic has prefix: /costar/messages/','purple')
self.layout_.addWidget(self.message_contents)
self.layout_.addWidget(self.message_topic)
self.layout_.addWidget(self.wait_finish)
self.layout_.addWidget(self.note)

Expand All @@ -38,18 +46,22 @@ def load_data(self,data):
pass
def generate(self):
if all([self.name.full(),self.wait_finish.full()]):
return NodeActionPublishMessage(self.get_name(),self.get_label(),int(self.wait_finish.get()))
full_topic_name = os.path.join('/costar/messages/',str(self.message_topic.get()))
return NodeActionPublishMessage(self.get_name(),str(self.message_contents.get()), full_topic_name, int(self.wait_finish.get()))
else:
rospy.logerr('check that all menu items are properly selected for this node')
return 'ERROR: check that all menu items are properly selected for this node'

# Nodes -------------------------------------------------------------------
class NodeActionPublishMessage(ServiceNode):
def __init__(self,name,label,wait_finish):
L = "Publish Message: " + label
def __init__(self,name,message_contents,topic_name,wait_finish):
L = "Publish Message: " + message_contents + "\nto " + topic_name
super(NodeActionPublishMessage,self).__init__(name,L,colors['purple'].normal,"Message Server")
self.message_pub = rospy.Publisher('/instructor/message_server', String,queue_size=100)
self.message_to_publish = label
# if topic_name == '':
# self.message_pub = rospy.Publisher('/instructor/message_server', String,queue_size=100)
# else:
self.message_pub = rospy.Publisher(topic_name, String,queue_size=100)
self.message_to_publish = message_contents
if wait_finish == 0:
self.wait_finish = False
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ void RosSceneHypothesisAssessor::processDetectedObjectMsgs()
this->scene_graph_pub.publish(this->generateSceneGraphMsgs());
std_msgs::Empty done_msg;
this->done_message_pub.publish(done_msg);
std::cerr << "Published done message.\n";
}

this->mtx_.unlock();
Expand Down Expand Up @@ -463,6 +464,7 @@ void RosSceneHypothesisAssessor::processHypotheses()

std_msgs::Empty done_msg;
this->done_message_pub.publish(done_msg);
std::cerr << "Published done message.\n";

this->scene_graph_pub.publish(this->generateSceneGraphMsgs());

Expand Down
1 change: 1 addition & 0 deletions costar_tools/moveit_collision_environment/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ target_link_libraries(planning_scene_generator collision_env ${catkin_LIBRARIES}

## Declare a C++ executable
add_executable(moveit_collision_environment src/main_collision_env.cpp)
add_dependencies(moveit_collision_environment moveit_collision_environment_generate_messages_cpp)

## Add cmake target dependencies of the executable
## same as for the library above
Expand Down

0 comments on commit 30a7deb

Please sign in to comment.