Exemplo n.º 1
0
    def __init__(self, parent, id=wx.ID_ANY, title='PR2 GUI', pos=wx.DefaultPosition, size=(1280, 1024), style=wx.DEFAULT_FRAME_STYLE):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)
        
        rospy.ready('pr2_gui', anonymous=True)
        
        self._config = wx.Config("pr2_gui")
        self._aui_manager = wx.aui.AuiManager(self)

        self._visualizer_panel = visualizer_panel.DefaultVisualizationPanel(self)
        
        media_path = rostools.packspec.get_pkg_dir( "gazebo_robot_description" )
        media_path += "/world/Media/";
        
        media_paths = [media_path]
        media_paths.append(media_path)
        media_paths.append(media_path + "fonts")
        media_paths.append(media_path + "materials")
        media_paths.append(media_path + "materials/scripts")
        media_paths.append(media_path + "materials/programs")
        media_paths.append(media_path + "materials/textures")
        media_paths.append(media_path + "models")
        media_paths.append(media_path + "models/pr2")
        
        ogre_tools.initializeResources( media_paths )
        self._visualizer_panel.createDefaultVisualizers()
        
        self._rosout_panel = wx_rosout.RosoutPanel(self)
        
        self._monitor_panel = MonitorPanel(self)
        self._monitor_panel.set_new_errors_callback(self.on_monitor_errors_received)
        
        self._interpreter = wx.py.shell.Shell(self)
        
        self._hardware_panel = hardware_panel.HardwarePanel(self)
        
        self._aui_manager.AddPane(self._visualizer_panel, wx.aui.AuiPaneInfo().CenterPane().Center().Name('3dvis').Caption('3D Visualization'), '3D Visualization')
        
        self._aui_manager.AddPane(self._interpreter, wx.aui.AuiPaneInfo().BottomDockable().Bottom().Name('interpreter').Caption('Python Interpreter').Hide(), 'Python Interpreter')
    
        self._aui_manager.AddPane(self._rosout_panel, wx.aui.AuiPaneInfo().BottomDockable().Bottom().Layer(1).BestSize(wx.Size(700, 200)).Name('rosout').Caption('Rosout'), 'Rosout')
        self._aui_manager.AddPane(self._monitor_panel, wx.aui.AuiPaneInfo().BottomDockable().Bottom().Layer(1).BestSize(wx.Size(700,600)).Name('runtime_monitor').Caption('Runtime Monitor'), 'Runtime Monitor')
        self._aui_manager.AddPane(self._hardware_panel, wx.aui.AuiPaneInfo().BottomDockable().Bottom().Layer(1).BestSize(wx.Size(300,200)).Name('hardware').Caption('Hardware'), 'Hardware')
        
        self.add_camera_pane("forearm_r", False)
        self.add_camera_pane("forearm_l", False)
        self.add_camera_pane("axis_r", True)
        self.add_camera_pane("axis_l", True)
        self.add_camera_pane("stereo_l", False)
        
        self._aui_manager.Update()
        
        self.load_config()
        
        self.create_menu_bar()
        
        self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_pane_close)
        self.Bind(wx.EVT_CLOSE, self.on_close)
Exemplo n.º 2
0
    def __init__(
        self,
        parent,
        id=wx.ID_ANY,
        title="Standalone Visualizer",
        pos=wx.DefaultPosition,
        size=(800, 600),
        style=wx.DEFAULT_FRAME_STYLE,
    ):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        ogre_tools.initializeOgre()
        visualizer_panel = ogre_visualizer.VisualizationPanel(self)

        self._package_path = rostools.packspec.get_pkg_dir("ogre_visualizer")
        self._global_config_path = os.path.join(self._package_path, "configs")

        self._visualizer_panel = visualizer_panel

        media_path = rostools.packspec.get_pkg_dir("gazebo_robot_description")
        media_path += "/world/Media/"

        media_paths = [media_path]
        media_paths.append(media_path)
        media_paths.append(media_path + "fonts")
        media_paths.append(media_path + "materials")
        media_paths.append(media_path + "materials/scripts")
        media_paths.append(media_path + "materials/programs")
        media_paths.append(media_path + "materials/textures")
        media_paths.append(media_path + "models")
        media_paths.append(media_path + "models/pr2_new")

        ogre_tools.initializeResources(media_paths)

        self.init_config()
        self.init_menu()

        manager = visualizer_panel.getManager()

        # Load our window options
        (x, y) = self.GetPositionTuple()
        (width, height) = self.GetSizeTuple()
        if self._config.HasEntry(self._CONFIG_WINDOW_X):
            x = self._config.ReadInt(self._CONFIG_WINDOW_X)
        if self._config.HasEntry(self._CONFIG_WINDOW_Y):
            y = self._config.ReadInt(self._CONFIG_WINDOW_Y)
        if self._config.HasEntry(self._CONFIG_WINDOW_WIDTH):
            width = self._config.ReadInt(self._CONFIG_WINDOW_WIDTH)
        if self._config.HasEntry(self._CONFIG_WINDOW_HEIGHT):
            height = self._config.ReadInt(self._CONFIG_WINDOW_HEIGHT)

        self.SetPosition((x, y))
        self.SetSize((width, height))

        manager.loadConfig(self._config)

        self.Bind(wx.EVT_CLOSE, self.on_close)
Exemplo n.º 3
0
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 title='Standalone Visualizer',
                 pos=wx.DefaultPosition,
                 size=(800, 600),
                 style=wx.DEFAULT_FRAME_STYLE):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        ogre_tools.initializeOgre()
        visualizer_panel = ogre_visualizer.VisualizationPanel(self)

        self._package_path = rostools.packspec.get_pkg_dir('ogre_visualizer')
        self._global_config_path = os.path.join(self._package_path, "configs")

        self._visualizer_panel = visualizer_panel

        media_path = rostools.packspec.get_pkg_dir("gazebo_robot_description")
        media_path += "/world/Media/"

        media_paths = [media_path]
        media_paths.append(media_path)
        media_paths.append(media_path + "fonts")
        media_paths.append(media_path + "materials")
        media_paths.append(media_path + "materials/scripts")
        media_paths.append(media_path + "materials/programs")
        media_paths.append(media_path + "materials/textures")
        media_paths.append(media_path + "models")
        media_paths.append(media_path + "models/pr2")

        ogre_tools.initializeResources(media_paths)

        self.init_config()
        self.init_menu()

        manager = visualizer_panel.getManager()

        # Load our window options
        (x, y) = self.GetPositionTuple()
        (width, height) = self.GetSizeTuple()
        if (self._config.HasEntry(self._CONFIG_WINDOW_X)):
            x = self._config.ReadInt(self._CONFIG_WINDOW_X)
        if (self._config.HasEntry(self._CONFIG_WINDOW_Y)):
            y = self._config.ReadInt(self._CONFIG_WINDOW_Y)
        if (self._config.HasEntry(self._CONFIG_WINDOW_WIDTH)):
            width = self._config.ReadInt(self._CONFIG_WINDOW_WIDTH)
        if (self._config.HasEntry(self._CONFIG_WINDOW_HEIGHT)):
            height = self._config.ReadInt(self._CONFIG_WINDOW_HEIGHT)

        self.SetPosition((x, y))
        self.SetSize((width, height))

        manager.loadConfig(self._config)

        self.Bind(wx.EVT_CLOSE, self.on_close)
Exemplo n.º 4
0
    def __init__(self, parent, id=wx.ID_ANY, title='Standalone Visualizer', pos=wx.DefaultPosition, size=(800, 600), style=wx.DEFAULT_FRAME_STYLE):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)
        
        self._config = wx.Config("standalone_visualizer")

        ogre_tools.initializeOgre()
        
        visualizer_panel = ogre_visualizer.VisualizationPanel(self)
        
        self._visualizer_panel = visualizer_panel
        
        media_path = rostools.packspec.get_pkg_dir( "gazebo_robot_description" )
        media_path += "/world/Media/";
        
        media_paths = [media_path]
        media_paths.append( media_path )
        media_paths.append( media_path + "fonts" )
        media_paths.append( media_path + "materials" )
        media_paths.append( media_path + "materials/scripts" )
        media_paths.append( media_path + "materials/programs" )
        media_paths.append( media_path + "materials/textures" )
        media_paths.append( media_path + "models" )
        media_paths.append( media_path + "models/pr2_new" )
        
        ogre_tools.initializeResources( media_paths )
        
        visualizer_panel.createGridVisualizer( "Grid", True )
        visualizer_panel.createAxesVisualizer( "Origin Axes", False )
        visualizer_panel.createMarkerVisualizer( "Visualization Markers", True )
        
        robot_vis = visualizer_panel.createRobotModelVisualizer( "Robot Model", False )
        robot_vis.setRobotDescription( "robotdesc/pr2" )
        
        planning = visualizer_panel.createPlanningVisualizer( "Planning", False )
        planning.initialize( "robotdesc/pr2", "display_kinematic_path" )
        
        point_cloud = visualizer_panel.createPointCloudVisualizer( "Stereo Full Cloud", True )
        point_cloud.setTopic( "videre/cloud" )
        point_cloud.setColor( 1.0, 1.0, 1.0 )
        
        point_cloud = visualizer_panel.createPointCloudVisualizer( "Head Full Cloud", True )
        point_cloud.setTopic( "full_cloud" )
        point_cloud.setColor( 1.0, 1.0, 0.0 )
        
        point_cloud = visualizer_panel.createPointCloudVisualizer( "World 3D Map", True )
        point_cloud.setTopic( "world_3d_map" )
        point_cloud.setColor( 1.0, 0.0, 0.0 )
        point_cloud.setBillboardSize( 0.01 )
        
        laser_scan = visualizer_panel.createLaserScanVisualizer( "Head Scan", True )
        laser_scan.setScanTopic( "tilt_scan" )
        laser_scan.setColor( 1.0, 0.0, 0.0 )
        laser_scan.setDecayTime( 30.0 )
        
        laser_scan = visualizer_panel.createLaserScanVisualizer( "Floor Scan", True )
        laser_scan.setScanTopic( "base_scan" )
        laser_scan.setColor( 0.0, 1.0, 0.0 )
        laser_scan.setDecayTime( 0.0 )
        
        visualizer_panel.createOctreeVisualizer( "Octree", True ).setOctreeTopic( "full_octree" )
        
        # Load our window options
        (x, y) = self.GetPositionTuple()
        (width, height) = self.GetSizeTuple()
        if (self._config.HasEntry(self._CONFIG_WINDOW_X)):
            x = self._config.ReadInt(self._CONFIG_WINDOW_X)
        if (self._config.HasEntry(self._CONFIG_WINDOW_Y)):
            y = self._config.ReadInt(self._CONFIG_WINDOW_Y)
        if (self._config.HasEntry(self._CONFIG_WINDOW_WIDTH)):
            width = self._config.ReadInt(self._CONFIG_WINDOW_WIDTH)
        if (self._config.HasEntry(self._CONFIG_WINDOW_HEIGHT)):
            height = self._config.ReadInt(self._CONFIG_WINDOW_HEIGHT)
            
        self.SetPosition((x, y))
        self.SetSize((width, height))
        
        visualizer_panel.loadConfig(self._config)
        
        self.Bind(wx.EVT_CLOSE, self.on_close)
Exemplo n.º 5
0
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 title='Standalone Visualizer',
                 pos=wx.DefaultPosition,
                 size=(800, 600),
                 style=wx.DEFAULT_FRAME_STYLE):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        self._config = wx.Config("standalone_visualizer")

        ogre_tools.initializeOgre()

        visualizer_panel = ogre_visualizer.VisualizationPanel(self)

        self._visualizer_panel = visualizer_panel

        media_path = rostools.packspec.get_pkg_dir("gazebo_robot_description")
        media_path += "/world/Media/"

        media_paths = [media_path]
        media_paths.append(media_path)
        media_paths.append(media_path + "fonts")
        media_paths.append(media_path + "materials")
        media_paths.append(media_path + "materials/scripts")
        media_paths.append(media_path + "materials/programs")
        media_paths.append(media_path + "materials/textures")
        media_paths.append(media_path + "models")
        media_paths.append(media_path + "models/pr2_new")

        ogre_tools.initializeResources(media_paths)

        visualizer_panel.createGridVisualizer("Grid", True)
        visualizer_panel.createAxesVisualizer("Origin Axes", False)
        visualizer_panel.createMarkerVisualizer("Visualization Markers", True)

        robot_vis = visualizer_panel.createRobotModelVisualizer(
            "Robot Model", False)
        robot_vis.setRobotDescription("robotdesc/pr2")

        planning = visualizer_panel.createPlanningVisualizer("Planning", False)
        planning.initialize("robotdesc/pr2", "display_kinematic_path")

        point_cloud = visualizer_panel.createPointCloudVisualizer(
            "Stereo Full Cloud", True)
        point_cloud.setTopic("videre/cloud")
        point_cloud.setColor(1.0, 1.0, 1.0)

        point_cloud = visualizer_panel.createPointCloudVisualizer(
            "Head Full Cloud", True)
        point_cloud.setTopic("full_cloud")
        point_cloud.setColor(1.0, 1.0, 0.0)

        point_cloud = visualizer_panel.createPointCloudVisualizer(
            "World 3D Map", True)
        point_cloud.setTopic("world_3d_map")
        point_cloud.setColor(1.0, 0.0, 0.0)
        point_cloud.setBillboardSize(0.01)

        laser_scan = visualizer_panel.createLaserScanVisualizer(
            "Head Scan", True)
        laser_scan.setScanTopic("tilt_scan")
        laser_scan.setColor(1.0, 0.0, 0.0)
        laser_scan.setDecayTime(30.0)

        laser_scan = visualizer_panel.createLaserScanVisualizer(
            "Floor Scan", True)
        laser_scan.setScanTopic("base_scan")
        laser_scan.setColor(0.0, 1.0, 0.0)
        laser_scan.setDecayTime(0.0)

        visualizer_panel.createOctreeVisualizer(
            "Octree", True).setOctreeTopic("full_octree")

        # Load our window options
        (x, y) = self.GetPositionTuple()
        (width, height) = self.GetSizeTuple()
        if (self._config.HasEntry(self._CONFIG_WINDOW_X)):
            x = self._config.ReadInt(self._CONFIG_WINDOW_X)
        if (self._config.HasEntry(self._CONFIG_WINDOW_Y)):
            y = self._config.ReadInt(self._CONFIG_WINDOW_Y)
        if (self._config.HasEntry(self._CONFIG_WINDOW_WIDTH)):
            width = self._config.ReadInt(self._CONFIG_WINDOW_WIDTH)
        if (self._config.HasEntry(self._CONFIG_WINDOW_HEIGHT)):
            height = self._config.ReadInt(self._CONFIG_WINDOW_HEIGHT)

        self.SetPosition((x, y))
        self.SetSize((width, height))

        visualizer_panel.loadConfig(self._config)

        self.Bind(wx.EVT_CLOSE, self.on_close)
Exemplo n.º 6
0
    def __init__(self,
                 parent,
                 id=wx.ID_ANY,
                 title='PR2 GUI',
                 pos=wx.DefaultPosition,
                 size=(1280, 1024),
                 style=wx.DEFAULT_FRAME_STYLE):
        wx.Frame.__init__(self, parent, id, title, pos, size, style)

        rospy.ready('pr2_gui', anonymous=True)

        self._config = wx.Config("pr2_gui")
        self._aui_manager = wx.aui.AuiManager(self)

        self._visualizer_panel = visualizer_panel.DefaultVisualizationPanel(
            self)

        media_path = rostools.packspec.get_pkg_dir("gazebo_robot_description")
        media_path += "/world/Media/"

        media_paths = [media_path]
        media_paths.append(media_path)
        media_paths.append(media_path + "fonts")
        media_paths.append(media_path + "materials")
        media_paths.append(media_path + "materials/scripts")
        media_paths.append(media_path + "materials/programs")
        media_paths.append(media_path + "materials/textures")
        media_paths.append(media_path + "models")
        media_paths.append(media_path + "models/pr2_new")

        ogre_tools.initializeResources(media_paths)
        self._visualizer_panel.createDefaultVisualizers()

        self._rosout_panel = wx_rosout.RosoutPanel(self)

        self._monitor_panel = MonitorPanel(self)
        self._monitor_panel.set_new_errors_callback(
            self.on_monitor_errors_received)

        self._interpreter = wx.py.shell.Shell(self)

        self._hardware_panel = hardware_panel.HardwarePanel(self)

        self._aui_manager.AddPane(
            self._visualizer_panel,
            wx.aui.AuiPaneInfo().CenterPane().Center().Name('3dvis').Caption(
                '3D Visualization'), '3D Visualization')

        self._aui_manager.AddPane(
            self._interpreter,
            wx.aui.AuiPaneInfo().BottomDockable().Bottom().Name(
                'interpreter').Caption('Python Interpreter').Hide(),
            'Python Interpreter')

        self._aui_manager.AddPane(
            self._rosout_panel,
            wx.aui.AuiPaneInfo().BottomDockable().Bottom().Layer(1).BestSize(
                wx.Size(700, 200)).Name('rosout').Caption('Rosout'), 'Rosout')
        self._aui_manager.AddPane(
            self._monitor_panel,
            wx.aui.AuiPaneInfo().BottomDockable().Bottom().Layer(1).BestSize(
                wx.Size(
                    700,
                    600)).Name('runtime_monitor').Caption('Runtime Monitor'),
            'Runtime Monitor')
        self._aui_manager.AddPane(
            self._hardware_panel,
            wx.aui.AuiPaneInfo().BottomDockable().Bottom().Layer(1).BestSize(
                wx.Size(300, 200)).Name('hardware').Caption('Hardware'),
            'Hardware')

        self.add_camera_pane("forearm_right", False)
        self.add_camera_pane("forearm_left", False)
        self.add_camera_pane("axis_right", True)
        self.add_camera_pane("axis_left", True)
        self.add_camera_pane("stereo_left", False)

        self._aui_manager.Update()

        self.load_config()

        self.create_menu_bar()

        self.Bind(wx.aui.EVT_AUI_PANE_CLOSE, self.on_pane_close)
        self.Bind(wx.EVT_CLOSE, self.on_close)