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, thofmann/joint-pantilt has been updated discards 9f2af880fbdb5d2e882a3eba0dcdc8aab3415d1d (commit) to 1c7e7ac297aa28a3f83395bdaa251f9378f71b61 (commit) via f61be861ab80c92a4b6edb9944bbd9c83b40fb8e (commit) This update added new revisions after undoing existing revisions. That is to say, the old revision is not a strict subset of the new revision. This situation occurs when you --force push a change and generate a repository containing something like this: * -- * -- B -- O -- O -- O (9f2af880fbdb5d2e882a3eba0dcdc8aab3415d1d) \ N -- N -- N (1c7e7ac297aa28a3f83395bdaa251f9378f71b61) When this happens we assume that you've already had alert emails for all of the O revisions, and so we here report only the revisions in the N branch from the common base, B. http://git.fawkesrobotics.org/fawkes.git/thofmann/joint-pantilt Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - *Log* --------------------------------------------------------------- commit f61be861ab80c92a4b6edb9944bbd9c83b40fb8e Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Mon Jan 13 13:23:17 2014 +0100 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Wed Jan 15 12:57:01 2014 +0100 pantilt: initialize blackboard interfaces' velocities to zero instead of max http://git.fawkesrobotics.org/fawkes.git/commit/f61be86 http://trac.fawkesrobotics.org/changeset/f61be86 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit 1c7e7ac297aa28a3f83395bdaa251f9378f71b61 Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Wed Jan 15 12:58:14 2014 +0100 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Wed Jan 15 12:58:14 2014 +0100 pantilt: publish joint values in all drivers add JointInterface writers to dirperc and sony driver http://git.fawkesrobotics.org/fawkes.git/commit/1c7e7ac http://trac.fawkesrobotics.org/changeset/1c7e7ac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *Summary* ----------------------------------------------------------- src/plugins/pantilt/dirperc/dp_thread.cpp | 32 +++++++++++++++++++++++ src/plugins/pantilt/dirperc/dp_thread.h | 3 ++ src/plugins/pantilt/sony/evid100p_thread.cpp | 36 ++++++++++++++++++++++++- src/plugins/pantilt/sony/evid100p_thread.h | 4 +++ 4 files changed, 73 insertions(+), 2 deletions(-) - *Diffs* ------------------------------------------------------------- - *commit* f61be861ab80c92a4b6edb9944bbd9c83b40fb8e - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Mon Jan 13 13:23:17 2014 +0100 Subject: pantilt: initialize blackboard interfaces' velocities to zero instead of max src/plugins/pantilt/robotis/rx28_thread.cpp | 10 ++++++---- src/plugins/pantilt/sony/evid100p_thread.cpp | 7 +++++-- 2 files changed, 11 insertions(+), 6 deletions(-) _Diff for modified files_: diff --git a/src/plugins/pantilt/robotis/rx28_thread.cpp b/src/plugins/pantilt/robotis/rx28_thread.cpp index 325b66f..70fa777 100644 --- a/src/plugins/pantilt/robotis/rx28_thread.cpp +++ b/src/plugins/pantilt/robotis/rx28_thread.cpp @@ -73,6 +73,8 @@ void PanTiltRX28Thread::init() { __last_pan = __last_tilt = 0.f; + float init_pan_velocity = 0.f; + float init_tilt_velocity = 0.f; // Note: due to the use of auto_ptr and RefPtr resources are automatically // freed on destruction, therefore no special handling is necessary in init() @@ -175,8 +177,8 @@ PanTiltRX28Thread::init() __pantilt_if->set_tilt_margin(__cfg_tilt_margin); __pantilt_if->set_max_pan_velocity(__rx28->get_max_supported_speed(__cfg_pan_servo_id)); __pantilt_if->set_max_tilt_velocity(__rx28->get_max_supported_speed(__cfg_tilt_servo_id)); - __pantilt_if->set_pan_velocity(__rx28->get_max_supported_speed(__cfg_pan_servo_id)); - __pantilt_if->set_tilt_velocity(__rx28->get_max_supported_speed(__cfg_tilt_servo_id)); + __pantilt_if->set_pan_velocity(init_pan_velocity); + __pantilt_if->set_tilt_velocity(init_tilt_velocity); __pantilt_if->write(); __led_if = blackboard->open_for_writing<LedInterface>(bbid.c_str()); @@ -184,13 +186,13 @@ PanTiltRX28Thread::init() std::string panid = __ptu_name + " pan"; __panjoint_if = blackboard->open_for_writing<JointInterface>(panid.c_str()); __panjoint_if->set_position(__last_pan); - __panjoint_if->set_velocity(__rx28->get_max_supported_speed(__cfg_pan_servo_id)); + __panjoint_if->set_velocity(init_pan_velocity); __panjoint_if->write(); std::string tiltid = __ptu_name + " tilt"; __tiltjoint_if = blackboard->open_for_writing<JointInterface>(tiltid.c_str()); __tiltjoint_if->set_position(__last_tilt); - __tiltjoint_if->set_velocity(__rx28->get_max_supported_speed(__cfg_tilt_servo_id)); + __tiltjoint_if->set_velocity(init_tilt_velocity); __tiltjoint_if->write(); __wt = new WorkerThread(__ptu_name, logger, __rx28, diff --git a/src/plugins/pantilt/sony/evid100p_thread.cpp b/src/plugins/pantilt/sony/evid100p_thread.cpp index e5bf844..e13af10 100644 --- a/src/plugins/pantilt/sony/evid100p_thread.cpp +++ b/src/plugins/pantilt/sony/evid100p_thread.cpp @@ -77,6 +77,9 @@ PanTiltSonyEviD100PThread::init() throw; } + float init_pan_velocity = 0.f; + float init_tilt_velocity = 0.f; + // If you have more than one interface: catch exception and close them! std::string bbid = "PanTilt " + __ptu_name; __pantilt_if = blackboard->open_for_writing<PanTiltInterface>(bbid.c_str()); @@ -91,8 +94,8 @@ PanTiltSonyEviD100PThread::init() __cam->get_speed_limits(pan_smin, pan_smax, tilt_smin, tilt_smax); __pantilt_if->set_max_pan_velocity(pan_smax); __pantilt_if->set_max_tilt_velocity(tilt_smax); - __pantilt_if->set_pan_velocity(pan_smax); - __pantilt_if->set_tilt_velocity(tilt_smax); + __pantilt_if->set_pan_velocity(init_pan_velocity); + __pantilt_if->set_tilt_velocity(init_tilt_velocity); __pantilt_if->write(); __wt = new WorkerThread(__ptu_name, logger, __cam, - *commit* 1c7e7ac297aa28a3f83395bdaa251f9378f71b61 - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Wed Jan 15 12:58:14 2014 +0100 Subject: pantilt: publish joint values in all drivers src/plugins/pantilt/dirperc/dp_thread.cpp | 32 ++++++++++++++++++++++++++ src/plugins/pantilt/dirperc/dp_thread.h | 3 ++ src/plugins/pantilt/sony/evid100p_thread.cpp | 29 +++++++++++++++++++++++ src/plugins/pantilt/sony/evid100p_thread.h | 4 +++ 4 files changed, 68 insertions(+), 0 deletions(-) _Diff for modified files_: diff --git a/src/plugins/pantilt/dirperc/dp_thread.cpp b/src/plugins/pantilt/dirperc/dp_thread.cpp index 0c9796d..14275fa 100644 --- a/src/plugins/pantilt/dirperc/dp_thread.cpp +++ b/src/plugins/pantilt/dirperc/dp_thread.cpp @@ -25,6 +25,7 @@ #include <core/threading/mutex_locker.h> #include <interfaces/PanTiltInterface.h> +#include <interfaces/JointInterface.h> #include <cstdarg> #include <cmath> @@ -89,10 +90,29 @@ PanTiltDirectedPerceptionThread::init() //__pantilt_if->set_tilt_velocity(0); __pantilt_if->write(); + float init_pan = 0.f; + float init_tilt = 0.f; + float init_pan_velocity = 0.f; + float init_tilt_velocity = 0.f; + + std::string panid = __ptu_name + " pan"; + __panjoint_if = blackboard->open_for_writing<JointInterface>(panid.c_str()); + __panjoint_if->set_position(init_pan); + __panjoint_if->set_velocity(init_pan_velocity); + __panjoint_if->write(); + + std::string tiltid = __ptu_name + " tilt"; + __tiltjoint_if = blackboard->open_for_writing<JointInterface>(tiltid.c_str()); + __tiltjoint_if->set_position(init_tilt); + __tiltjoint_if->set_velocity(init_tilt_velocity); + __tiltjoint_if->write(); + __wt = new WorkerThread(__ptu_name, logger, __ptu); __wt->start(); bbil_add_message_interface(__pantilt_if); + bbil_add_message_interface(__panjoint_if); + bbil_add_message_interface(__tiltjoint_if); blackboard->register_listener(this); #ifdef USE_TIMETRACKER @@ -109,6 +129,8 @@ PanTiltDirectedPerceptionThread::finalize() { blackboard->unregister_listener(this); blackboard->close(__pantilt_if); + blackboard->close(__panjoint_if); + blackboard->close(__tiltjoint_if); __wt->cancel(); __wt->join(); @@ -133,6 +155,12 @@ PanTiltDirectedPerceptionThread::update_sensor_values() __pantilt_if->set_tilt(tilt); __pantilt_if->set_final(__wt->is_final()); __pantilt_if->write(); + + __panjoint_if->set_position(pan); + __panjoint_if->write(); + + __tiltjoint_if->set_position(tilt); + __tiltjoint_if->write(); } } @@ -181,6 +209,10 @@ PanTiltDirectedPerceptionThread::loop() __wt->set_velocities(msg->pan_velocity(), msg->tilt_velocity()); __pantilt_if->set_pan_velocity(msg->pan_velocity()); __pantilt_if->set_tilt_velocity(msg->tilt_velocity()); + __panjoint_if->set_velocity(msg->pan_velocity()); + __panjoint_if->write(); + __tiltjoint_if->set_velocity(msg->tilt_velocity()); + __tiltjoint_if->write(); } */ diff --git a/src/plugins/pantilt/dirperc/dp_thread.h b/src/plugins/pantilt/dirperc/dp_thread.h index 3179979..718dd78 100644 --- a/src/plugins/pantilt/dirperc/dp_thread.h +++ b/src/plugins/pantilt/dirperc/dp_thread.h @@ -35,6 +35,7 @@ namespace fawkes { class PanTiltInterface; + class JointInterface; } class DirectedPerceptionPTU; @@ -63,6 +64,8 @@ class PanTiltDirectedPerceptionThread private: fawkes::PanTiltInterface *__pantilt_if; + fawkes::JointInterface *__panjoint_if; + fawkes::JointInterface *__tiltjoint_if; fawkes::RefPtr<DirectedPerceptionPTU> __ptu; diff --git a/src/plugins/pantilt/sony/evid100p_thread.cpp b/src/plugins/pantilt/sony/evid100p_thread.cpp index e13af10..2653156 100644 --- a/src/plugins/pantilt/sony/evid100p_thread.cpp +++ b/src/plugins/pantilt/sony/evid100p_thread.cpp @@ -25,6 +25,7 @@ #include <core/threading/mutex_locker.h> #include <interfaces/PanTiltInterface.h> +#include <interfaces/JointInterface.h> #include <cstdarg> #include <cmath> @@ -77,6 +78,8 @@ PanTiltSonyEviD100PThread::init() throw; } + float init_pan = 0.f; + float init_tilt = 0.f; float init_pan_velocity = 0.f; float init_tilt_velocity = 0.f; @@ -98,6 +101,18 @@ PanTiltSonyEviD100PThread::init() __pantilt_if->set_tilt_velocity(init_tilt_velocity); __pantilt_if->write(); + std::string panid = __ptu_name + " pan"; + __panjoint_if = blackboard->open_for_writing<JointInterface>(panid.c_str()); + __panjoint_if->set_position(init_pan); + __panjoint_if->set_velocity(init_pan_velocity); + __panjoint_if->write(); + + std::string tiltid = __ptu_name + " tilt"; + __tiltjoint_if = blackboard->open_for_writing<JointInterface>(tiltid.c_str()); + __tiltjoint_if->set_position(init_tilt); + __tiltjoint_if->set_velocity(init_tilt_velocity); + __tiltjoint_if->write(); + __wt = new WorkerThread(__ptu_name, logger, __cam, SonyEviD100PVisca::MIN_PAN_RAD, SonyEviD100PVisca::MAX_PAN_RAD, SonyEviD100PVisca::MIN_TILT_RAD, SonyEviD100PVisca::MAX_TILT_RAD); @@ -106,6 +121,8 @@ PanTiltSonyEviD100PThread::init() __wt->set_velocities(pan_smax, tilt_smax); bbil_add_message_interface(__pantilt_if); + bbil_add_message_interface(__panjoint_if); + bbil_add_message_interface(__tiltjoint_if); blackboard->register_listener(this); #ifdef USE_TIMETRACKER @@ -122,6 +139,8 @@ PanTiltSonyEviD100PThread::finalize() { blackboard->unregister_listener(this); blackboard->close(__pantilt_if); + blackboard->close(__panjoint_if); + blackboard->close(__tiltjoint_if); __wt->cancel(); __wt->join(); @@ -146,6 +165,12 @@ PanTiltSonyEviD100PThread::update_sensor_values() __pantilt_if->set_tilt(tilt); __pantilt_if->set_final(__wt->is_final()); __pantilt_if->write(); + + __panjoint_if->set_position(pan); + __panjoint_if->write(); + + __tiltjoint_if->set_position(tilt); + __tiltjoint_if->write(); } } @@ -196,6 +221,10 @@ PanTiltSonyEviD100PThread::loop() __wt->set_velocities(msg->pan_velocity(), msg->tilt_velocity()); __pantilt_if->set_pan_velocity(msg->pan_velocity()); __pantilt_if->set_tilt_velocity(msg->tilt_velocity()); + __panjoint_if->set_velocity(msg->pan_velocity()); + __panjoint_if->write(); + __tiltjoint_if->set_velocity(msg->tilt_velocity()); + __tiltjoint_if->write(); } } else { diff --git a/src/plugins/pantilt/sony/evid100p_thread.h b/src/plugins/pantilt/sony/evid100p_thread.h index be933dc..2af3f35 100644 --- a/src/plugins/pantilt/sony/evid100p_thread.h +++ b/src/plugins/pantilt/sony/evid100p_thread.h @@ -35,6 +35,7 @@ namespace fawkes { class PanTiltInterface; + class JointInterface; } class SonyEviD100PVisca; @@ -63,6 +64,8 @@ class PanTiltSonyEviD100PThread private: fawkes::PanTiltInterface *__pantilt_if; + fawkes::JointInterface *__panjoint_if; + fawkes::JointInterface *__tiltjoint_if; fawkes::RefPtr<SonyEviD100PVisca> __cam; @@ -71,6 +74,7 @@ class PanTiltSonyEviD100PThread std::string __ptu_name; std::string __cfg_device; unsigned int __cfg_read_timeout_ms; + bool __cfg_publish_transforms; class WorkerThread : public fawkes::Thread -- Fawkes Robotics Framework http://www.fawkesrobotics.org _______________________________________________ fawkes-commits mailing list fawkes-commits@lists.kbsg.rwth-aachen.de https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits