[Fawkes Git] branch/nlimpert/joystick_teleop_w_gripper: created (0.5.0-3087-g23f2797)

Nicolas Limpert nicolas.limpert at alumni.fh-aachen.de
Sun Jun 19 14:57:17 CEST 2016


Changes have been pushed for the project "Fawkes Robotics Software Framework".

Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, nlimpert/joystick_teleop_w_gripper has been created
        at  23f27975c77b3ab26bb88f46f0846f348f67eae6 (commit)

http://git.fawkesrobotics.org/fawkes.git/nlimpert/joystick_teleop_w_gripper

- *Log* ---------------------------------------------------------------
commit 519c04d6a5365ac7aadbf946b8f5c56ad2ea250a
Author:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
AuthorDate: Sun Jun 19 13:58:30 2016 +0200
Commit:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
CommitDate: Sun Jun 19 14:30:30 2016 +0200

    joystick_teleop: add ArduinoInterface to teleop_thread
    
    The usage of the ArduinoInterface is needed to control the stepper motor
    controlled by the Arduino.

http://git.fawkesrobotics.org/fawkes.git/commit/519c04d
http://trac.fawkesrobotics.org/changeset/519c04d

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit d7c7db77db4f41e80f2fc0be7b4bec4cdf98fcc9
Author:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
AuthorDate: Sun Jun 19 14:24:01 2016 +0200
Commit:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
CommitDate: Sun Jun 19 14:30:30 2016 +0200

    joystick_teleop: add config values for ArduinoInterface
    
    The ArduinoInterface requires setting a name to open for reading. This
    is handled by setting a name in the configuration of the joystick
    plugin.

http://git.fawkesrobotics.org/fawkes.git/commit/d7c7db7
http://trac.fawkesrobotics.org/changeset/d7c7db7

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 5f2f0908978bff8e21060e6adab6f798fc4d2111
Author:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
AuthorDate: Sun Jun 19 14:32:24 2016 +0200
Commit:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
CommitDate: Sun Jun 19 14:35:25 2016 +0200

    joystick_teleop: add d-pad button handling for stepper
    
    The plugin now accepts reactions on pressing the up- and down buttons of
    the d-pad of an xbox-controller.
    It will let the user move the gripper upwards or downwards by 1mm per
    button press.

http://git.fawkesrobotics.org/fawkes.git/commit/5f2f090
http://trac.fawkesrobotics.org/changeset/5f2f090

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit b5cde408cdbccd43275206b712e21f1fe72085e2
Author:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
AuthorDate: Sun Jun 19 14:48:59 2016 +0200
Commit:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
CommitDate: Sun Jun 19 14:48:59 2016 +0200

    joystick_teleop: add AX12GripperInterface to teleop_thread
    
    The usage of the AX12GripperInterface is needed to control the
    gripper and send open and close commands to the responsible
    plugin.

http://git.fawkesrobotics.org/fawkes.git/commit/b5cde40
http://trac.fawkesrobotics.org/changeset/b5cde40

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 178b21c4922fecb644a1ab6a619ccc85fdcc43fa
Author:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
AuthorDate: Sun Jun 19 14:52:40 2016 +0200
Commit:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
CommitDate: Sun Jun 19 14:53:57 2016 +0200

    joystick_teleop: add config values for AX12GripperInterface
    
    The AX12GripperInterface requires setting a name to open for reading.
    This is handled by setting a name in the configuration of the joystick
    plugin.

http://git.fawkesrobotics.org/fawkes.git/commit/178b21c
http://trac.fawkesrobotics.org/changeset/178b21c

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
commit 23f27975c77b3ab26bb88f46f0846f348f67eae6
Author:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
AuthorDate: Sun Jun 19 14:54:47 2016 +0200
Commit:     Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
CommitDate: Sun Jun 19 14:54:47 2016 +0200

    joystick_teleop: add d-pad handling for AX12-Gripper
    
    The gripper can now be opened or closed by pressing the left (to open)
    or the right (to close) buttons on the d-pad.

http://git.fawkesrobotics.org/fawkes.git/commit/23f2797
http://trac.fawkesrobotics.org/changeset/23f2797

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------
 cfg/conf.d/joystick.yaml                        |    6 ++++
 src/plugins/joystick/Makefile                   |    2 +-
 src/plugins/joystick/joystick_teleop_thread.cpp |   32 +++++++++++++++++++++++
 src/plugins/joystick/joystick_teleop_thread.h   |    3 ++
 4 files changed, 42 insertions(+), 1 deletions(-)


- *Diffs* -------------------------------------------------------------

- *commit* 519c04d6a5365ac7aadbf946b8f5c56ad2ea250a - - - - - - - - - -
Author:  Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
Date:    Sun Jun 19 13:58:30 2016 +0200
Subject: joystick_teleop: add ArduinoInterface to teleop_thread

 src/plugins/joystick/Makefile                 |    3 ++-
 src/plugins/joystick/joystick_teleop_thread.h |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/joystick/Makefile b/src/plugins/joystick/Makefile
index 4dfa1e4..bc58866 100644
--- a/src/plugins/joystick/Makefile
+++ b/src/plugins/joystick/Makefile
@@ -32,7 +32,8 @@ OBJS_ffkbjoystick = ffkbjoystick.o remote_bb_poster.o bb_handler.o
 
 LIBS_joystick_teleop = m fawkescore fawkesutils fawkesaspects \
 		       fawkesblackboard fawkesinterface \
-		       JoystickInterface MotorInterface Laser360Interface
+		       JoystickInterface MotorInterface Laser360Interface \
+		       ArduinoInterface
 OBJS_joystick_teleop = joystick_teleop_plugin.o joystick_teleop_thread.o
 
 OBJS_all = $(OBJS_joystick) $(OBJS_ffjoystick) $(OBJS_ffkbjoystick) $(OBJS_joystick_teleop) 
diff --git a/src/plugins/joystick/joystick_teleop_thread.h b/src/plugins/joystick/joystick_teleop_thread.h
index 7e9863b..3cbeebc 100644
--- a/src/plugins/joystick/joystick_teleop_thread.h
+++ b/src/plugins/joystick/joystick_teleop_thread.h
@@ -28,6 +28,8 @@
 #include <aspect/configurable.h>
 #include <aspect/blackboard.h>
 
+#include <interfaces/ArduinoInterface.h>
+
 #include <string>
 #include <cfloat>
 
@@ -64,6 +66,7 @@ class JoystickTeleOpThread
   fawkes::MotorInterface     *motor_if_;
   fawkes::JoystickInterface  *joystick_if_;
   fawkes::Laser360Interface  *laser_if_;
+  fawkes::ArduinoInterface  *arduino_if_;
 
   unsigned int cfg_axis_forward_;
   unsigned int cfg_axis_sideward_;
@@ -88,6 +91,7 @@ class JoystickTeleOpThread
   unsigned int cfg_collision_safety_angle_;
   std::string  cfg_ifid_motor_;
   std::string  cfg_ifid_joystick_;
+  std::string  cfg_ifid_arduino_;
   bool         cfg_use_laser_;
   std::string  cfg_ifid_laser_;
 

- *commit* d7c7db77db4f41e80f2fc0be7b4bec4cdf98fcc9 - - - - - - - - - -
Author:  Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
Date:    Sun Jun 19 14:24:01 2016 +0200
Subject: joystick_teleop: add config values for ArduinoInterface

 cfg/conf.d/joystick.yaml                        |    3 +++
 src/plugins/joystick/joystick_teleop_thread.cpp |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/cfg/conf.d/joystick.yaml b/cfg/conf.d/joystick.yaml
index 57f690b..8b80be1 100644
--- a/cfg/conf.d/joystick.yaml
+++ b/cfg/conf.d/joystick.yaml
@@ -101,5 +101,8 @@ doc-url: !url http://trac.fawkesrobotics.org/wiki/Plugins/joystick
     # Interface ID for JoystickInterface to read data from
     joystick_interface_id: Joystick
 
+    # Interface ID for Arduino to control the stepper motor
+    arduino_interface_id: Arduino
+
     # Interface ID for Laser360Interface
     laser_interface_id: Laser urg filtered
diff --git a/src/plugins/joystick/joystick_teleop_thread.cpp b/src/plugins/joystick/joystick_teleop_thread.cpp
index 9226561..ce9c43d 100644
--- a/src/plugins/joystick/joystick_teleop_thread.cpp
+++ b/src/plugins/joystick/joystick_teleop_thread.cpp
@@ -97,6 +97,9 @@ JoystickTeleOpThread::init()
   joystick_if_ =
     blackboard->open_for_reading<JoystickInterface>(cfg_ifid_joystick_.c_str());
 
+  cfg_ifid_arduino_ = config->get_string(CFG_PREFIX"arduino_interface_id");
+  arduino_if_ = blackboard->open_for_reading<ArduinoInterface>(cfg_ifid_arduino_.c_str());
+
   cfg_use_laser_ = false;
   laser_if_ = NULL;
   if (cfg_collision_safety_) {

- *commit* 5f2f0908978bff8e21060e6adab6f798fc4d2111 - - - - - - - - - -
Author:  Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
Date:    Sun Jun 19 14:32:24 2016 +0200
Subject: joystick_teleop: add d-pad button handling for stepper

 src/plugins/joystick/joystick_teleop_thread.cpp |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/joystick/joystick_teleop_thread.cpp b/src/plugins/joystick/joystick_teleop_thread.cpp
index ce9c43d..b37a836 100644
--- a/src/plugins/joystick/joystick_teleop_thread.cpp
+++ b/src/plugins/joystick/joystick_teleop_thread.cpp
@@ -190,6 +190,7 @@ JoystickTeleOpThread::loop()
 {
   joystick_if_->read();
   if (laser_if_)  laser_if_->read();
+  arduino_if_->read();
 
   if ((! joystick_if_->has_writer() || joystick_if_->num_axes() == 0) && ! stopped_) {
     logger->log_warn(name(), "Joystick disconnected, stopping");
@@ -202,6 +203,20 @@ JoystickTeleOpThread::loop()
   {
     logger->log_warn(name(), "Axis number out of range, stopping");
     stop();
+  } else if (joystick_if_->pressed_buttons() == JoystickInterface::BUTTON_15 &&
+             arduino_if_->is_final())
+  {
+      ArduinoInterface::MoveDownwardsMessage *msg =
+                  new ArduinoInterface::MoveDownwardsMessage();
+      msg->set_num_mm(1);
+      arduino_if_->msgq_enqueue_copy(msg);
+  } else if (joystick_if_->pressed_buttons() == JoystickInterface::BUTTON_14 &&
+             arduino_if_->is_final())
+  {
+      ArduinoInterface::MoveUpwardsMessage *msg =
+                  new ArduinoInterface::MoveUpwardsMessage();
+      msg->set_num_mm(1);
+      arduino_if_->msgq_enqueue_copy(msg);
   } else if ((joystick_if_->pressed_buttons() & cfg_deadman_butmask_) ||
 	     (cfg_deadman_use_axis_ &&
 	      ((cfg_deadman_ax_thresh_ >= 0 && joystick_if_->axis(cfg_deadman_axis_) > cfg_deadman_ax_thresh_) ||

- *commit* b5cde408cdbccd43275206b712e21f1fe72085e2 - - - - - - - - - -
Author:  Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
Date:    Sun Jun 19 14:48:59 2016 +0200
Subject: joystick_teleop: add AX12GripperInterface to teleop_thread

 src/plugins/joystick/Makefile                 |    2 +-
 src/plugins/joystick/joystick_teleop_thread.h |    3 +++
 2 files changed, 4 insertions(+), 1 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/joystick/Makefile b/src/plugins/joystick/Makefile
index bc58866..a36f9fb 100644
--- a/src/plugins/joystick/Makefile
+++ b/src/plugins/joystick/Makefile
@@ -33,7 +33,7 @@ OBJS_ffkbjoystick = ffkbjoystick.o remote_bb_poster.o bb_handler.o
 LIBS_joystick_teleop = m fawkescore fawkesutils fawkesaspects \
 		       fawkesblackboard fawkesinterface \
 		       JoystickInterface MotorInterface Laser360Interface \
-		       ArduinoInterface
+		       ArduinoInterface AX12GripperInterface
 OBJS_joystick_teleop = joystick_teleop_plugin.o joystick_teleop_thread.o
 
 OBJS_all = $(OBJS_joystick) $(OBJS_ffjoystick) $(OBJS_ffkbjoystick) $(OBJS_joystick_teleop) 
diff --git a/src/plugins/joystick/joystick_teleop_thread.h b/src/plugins/joystick/joystick_teleop_thread.h
index 3cbeebc..82da0ce 100644
--- a/src/plugins/joystick/joystick_teleop_thread.h
+++ b/src/plugins/joystick/joystick_teleop_thread.h
@@ -28,6 +28,7 @@
 #include <aspect/configurable.h>
 #include <aspect/blackboard.h>
 
+#include <interfaces/AX12GripperInterface.h>
 #include <interfaces/ArduinoInterface.h>
 
 #include <string>
@@ -66,6 +67,7 @@ class JoystickTeleOpThread
   fawkes::MotorInterface     *motor_if_;
   fawkes::JoystickInterface  *joystick_if_;
   fawkes::Laser360Interface  *laser_if_;
+  fawkes::AX12GripperInterface  *ax12_gripper_if_;
   fawkes::ArduinoInterface  *arduino_if_;
 
   unsigned int cfg_axis_forward_;
@@ -92,6 +94,7 @@ class JoystickTeleOpThread
   std::string  cfg_ifid_motor_;
   std::string  cfg_ifid_joystick_;
   std::string  cfg_ifid_arduino_;
+  std::string  cfg_ifid_ax12_gripper_;
   bool         cfg_use_laser_;
   std::string  cfg_ifid_laser_;
 

- *commit* 178b21c4922fecb644a1ab6a619ccc85fdcc43fa - - - - - - - - - -
Author:  Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
Date:    Sun Jun 19 14:52:40 2016 +0200
Subject: joystick_teleop: add config values for AX12GripperInterface

 cfg/conf.d/joystick.yaml                        |    3 +++
 src/plugins/joystick/joystick_teleop_thread.cpp |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/cfg/conf.d/joystick.yaml b/cfg/conf.d/joystick.yaml
index 8b80be1..f729cf3 100644
--- a/cfg/conf.d/joystick.yaml
+++ b/cfg/conf.d/joystick.yaml
@@ -101,6 +101,9 @@ doc-url: !url http://trac.fawkesrobotics.org/wiki/Plugins/joystick
     # Interface ID for JoystickInterface to read data from
     joystick_interface_id: Joystick
 
+    # Interface ID for AX12GripperInterface to send Open or Close Messages to.
+    ax12_gripper_interface_id: Gripper AX12
+
     # Interface ID for Arduino to control the stepper motor
     arduino_interface_id: Arduino
 
diff --git a/src/plugins/joystick/joystick_teleop_thread.cpp b/src/plugins/joystick/joystick_teleop_thread.cpp
index b37a836..1826f83 100644
--- a/src/plugins/joystick/joystick_teleop_thread.cpp
+++ b/src/plugins/joystick/joystick_teleop_thread.cpp
@@ -97,6 +97,9 @@ JoystickTeleOpThread::init()
   joystick_if_ =
     blackboard->open_for_reading<JoystickInterface>(cfg_ifid_joystick_.c_str());
 
+  cfg_ifid_ax12_gripper_ = config->get_string(CFG_PREFIX"ax12_gripper_interface_id");
+  ax12_gripper_if_ = blackboard->open_for_reading<AX12GripperInterface>(cfg_ifid_ax12_gripper_.c_str());
+
   cfg_ifid_arduino_ = config->get_string(CFG_PREFIX"arduino_interface_id");
   arduino_if_ = blackboard->open_for_reading<ArduinoInterface>(cfg_ifid_arduino_.c_str());
 

- *commit* 23f27975c77b3ab26bb88f46f0846f348f67eae6 - - - - - - - - - -
Author:  Nicolas Limpert <nicolas.limpert at alumni.fh-aachen.de>
Date:    Sun Jun 19 14:54:47 2016 +0200
Subject: joystick_teleop: add d-pad handling for AX12-Gripper

 src/plugins/joystick/joystick_teleop_thread.cpp |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/joystick/joystick_teleop_thread.cpp b/src/plugins/joystick/joystick_teleop_thread.cpp
index 1826f83..905c5f8 100644
--- a/src/plugins/joystick/joystick_teleop_thread.cpp
+++ b/src/plugins/joystick/joystick_teleop_thread.cpp
@@ -194,6 +194,7 @@ JoystickTeleOpThread::loop()
   joystick_if_->read();
   if (laser_if_)  laser_if_->read();
   arduino_if_->read();
+  ax12_gripper_if_->read();
 
   if ((! joystick_if_->has_writer() || joystick_if_->num_axes() == 0) && ! stopped_) {
     logger->log_warn(name(), "Joystick disconnected, stopping");
@@ -220,6 +221,16 @@ JoystickTeleOpThread::loop()
                   new ArduinoInterface::MoveUpwardsMessage();
       msg->set_num_mm(1);
       arduino_if_->msgq_enqueue_copy(msg);
+  } else if (joystick_if_->pressed_buttons() == JoystickInterface::BUTTON_13)
+  {
+      AX12GripperInterface::OpenMessage *msg =
+                  new AX12GripperInterface::OpenMessage();
+      ax12_gripper_if_->msgq_enqueue_copy(msg);
+  } else if (joystick_if_->pressed_buttons() == JoystickInterface::BUTTON_12)
+  {
+      AX12GripperInterface::CloseMessage *msg =
+                  new AX12GripperInterface::CloseMessage();
+      ax12_gripper_if_->msgq_enqueue_copy(msg);
   } else if ((joystick_if_->pressed_buttons() & cfg_deadman_butmask_) ||
 	     (cfg_deadman_use_axis_ &&
 	      ((cfg_deadman_ax_thresh_ >= 0 && joystick_if_->axis(cfg_deadman_axis_) > cfg_deadman_ax_thresh_) ||




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org


More information about the fawkes-commits mailing list