Exemple #1
0
    def to_msg(self):
        '''
          Converts this app definition to ros msg format.

          :returns: ros message format of Rapp
          :rtype: rocon_app_manager_msgs.Rapp
        '''
        a = rapp_manager_msgs.Rapp()
        a.name = self.data['name']
        a.display_name = self.data['display_name']
        a.description = self.data['description']
        a.compatibility = self.data['compatibility']
        a.status = self.data['status']
        a.icon = rocon_python_utils.ros.icon_to_msg(self.data['icon'])
        a.implementations = []

        key = 'public_interface'
        if key in self.data:
            a.public_interface = [rocon_std_msgs.KeyValue(key, str(val)) for key, val in self.data[key].items()]

        key = 'public_parameters'
        if key in self.data:
            a.public_parameters = [rocon_std_msgs.KeyValue(str(key), str(val)) for key, val in self.data[key].items()]

        return a
Exemple #2
0
 def _publish_status(self):
     """
      Publish status updates whenever something significant changes, e.g.
      remote controller changed, or rapp started/stopped.
     """
     published_interfaces = []
     published_parameters = []
     rapp = rapp_manager_msgs.Rapp()
     rapp_status = rapp_manager_msgs.Status.RAPP_STOPPED
     if self.current_rapp:
         try:
             published_interfaces = self.current_rapp.published_interfaces_to_msg_list(
             )
             published_parameters = self.current_rapp.published_parameters_to_msg_list(
             )
             rapp = self.current_rapp.to_msg()
             rapp_status = rapp_manager_msgs.Status.RAPP_RUNNING
         except AttributeError:  # i.e. current_rapp is None
             # catch when self.current_rapp is NoneType since there is a miniscule chance
             # it might have changed inbetween the if check and the method calls
             pass  # nothing to do here as we predefine everything for this case.
     msg = rapp_manager_msgs.Status(
         application_namespace=self.parameters.application_namespace,
         rapp_status=rapp_status,
         rapp=rapp,
         published_interfaces=published_interfaces,
         published_parameters=published_parameters)
     try:
         self.publishers.status.publish(msg)
     except rospy.ROSException:  # publisher has unregistered - ros shutting down
         pass
Exemple #3
0
import concert_schedulers
import concert_schedulers.common
import concert_schedulers.compatibility_tree_scheduler as compatibility_tree_scheduler
import rosunit
import concert_msgs.msg as concert_msgs
import scheduler_msgs.msg as scheduler_msgs
import rocon_app_manager_msgs.msg as rocon_app_manager_msgs
import rocon_console.console as console

##############################################################################
# Rapps
##############################################################################

app_listener = rocon_app_manager_msgs.Rapp(
    name='rocon_apps/listener',
    display_name='Listener',
    description='Default ros style listener tutorial',
    platform='linux.*.ros.*')
app_talker = rocon_app_manager_msgs.Rapp(
    name='rocon_apps/talker',
    display_name='Talker',
    description='Default ros style talker tutorial',
    platform='linux.*.ros.*')
apps = [app_listener, app_talker]

##############################################################################
# Concert Clients
##############################################################################

concert_client_msgs = {}
concert_client_msgs['dude_foo'] = concert_msgs.ConcertClient(