Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
[robot_systemd](https://github.com/LucidOne/robot_systemd) to provide a GUI for
Systemd based control of roslaunch units.

![Indicator](https://raw.githubusercontent.com/LucidOne/robot_indicator/master/doc/indicator.png)
![Indicator](doc/indicator.png)

![Launch Package Selection](https://raw.githubusercontent.com/LucidOne/robot_indicator/master/doc/launch_package.png)
![Launch UI](https://raw.githubusercontent.com/LucidOne/robot_indicator/master/doc/launch_ui.png)
![Launch Package Selection](doc/launch_package.png)
![Launch UI](doc/launch_ui.png)

## TL;DR
```bash
mkdir -p ~/.config/autostart
cp `rospack find robot_indicator`/robot_indicator.desktop ~/.config/autostart/robot_indicator.desktop
rosrun robot_indicator robot_indicator
# or log out and log back in

# or as a service with robot_systemd
systemctl --user enable roslaunch@robot_indicator:robot_indicator.service
systemctl --user start roslaunch@robot_indicator:robot_indicator.service
```
Binary file modified doc/launch_package.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/launch_ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 15 additions & 9 deletions scripts/robot_indicator_launch
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,24 @@ class LaunchWindow(Gtk.Window):
self._box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
self.add(self._box)

self._pkg_label = Gtk.Label("ROS Package")
self._pkg_label = Gtk.Label.new("ROS Package")
self._pkg_label.set_xalign(0)
self._box.pack_start(self._pkg_label, True, True, 0)

self._entrycompletion = Gtk.EntryCompletion()
self._entrycompletion.set_model(self._pkg_liststore)
self._entrycompletion.set_text_column(0)
self._entrycompletion.connect("match-selected",self.on_selected_pkg_update_launch)

self._entry = Gtk.Entry()
self._entry.set_completion(self._entrycompletion)
self._entry.set_max_width_chars(42)
self._entry.connect("focus-out-event",self.on_focus_update_launch)
self._entrycompletion.connect("match-selected", self.on_selected_pkg_update_launch)

self._entry = Gtk.ComboBoxText.new_with_entry()
self._entry.set_model(self._pkg_liststore)
self._entry.get_child().set_completion(self._entrycompletion)
self._entry.get_child().set_max_width_chars(42)
self._entry.get_child().connect("focus-out-event", self.on_focus_update_launch)
self._entry.connect("changed", self.on_change_update_launch)
self._box.pack_start(self._entry, True, True, 0)

self._pkg_label = Gtk.Label("Launch File")
self._pkg_label = Gtk.Label.new("Launch File")
self._pkg_label.set_xalign(0)
self._box.pack_start(self._pkg_label, True, True, 0)

Expand Down Expand Up @@ -99,8 +101,12 @@ class LaunchWindow(Gtk.Window):
pkg = entry.get_text()
self.update_launch_files(pkg)

def on_change_update_launch(self, combo):
pkg = combo.get_active_text()
self.update_launch_files(pkg)

def on_selected_pkg_update_launch(self, widget, model, i):
pkg = model.get_value(i,0)
pkg = model.get_value(i, 0)
self.update_launch_files(pkg)

def on_change_set_launch(self, combo):
Expand Down