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-interface has been updated to 6a6a50af95c2271dc29e57659cdaba4a13524e3b (commit) via a7118333b4e5d2a116404f4be58e647d49f36815 (commit) from 3d7b7fd26260cdffdf8daeb01ad0f11e033f8266 (commit) http://git.fawkesrobotics.org/fawkes.git/thofmann/joint-interface 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 a7118333b4e5d2a116404f4be58e647d49f36815 Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Wed Sep 25 18:10:50 2013 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Wed Sep 25 18:10:50 2013 +0200 JointInterface: add velocity field also save the joint's velocity in the interface, not only its position http://git.fawkesrobotics.org/fawkes.git/commit/a711833 http://trac.fawkesrobotics.org/changeset/a711833 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - commit 6a6a50af95c2271dc29e57659cdaba4a13524e3b Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> AuthorDate: Wed Sep 25 18:11:51 2013 +0200 Commit: Till Hofmann <hofm...@kbsg.rwth-aachen.de> CommitDate: Wed Sep 25 18:11:51 2013 +0200 pantilt: write the joints' velocities to the JointInterfaces http://git.fawkesrobotics.org/fawkes.git/commit/6a6a50a http://trac.fawkesrobotics.org/changeset/6a6a50a - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *Summary* ----------------------------------------------------------- src/libs/interfaces/JointInterface.cpp | 38 ++++++++++++++++++++++++++- src/libs/interfaces/JointInterface.h | 6 ++++ src/libs/interfaces/JointInterface.xml | 3 ++ src/plugins/pantilt/robotis/rx28_thread.cpp | 4 +++ 4 files changed, 50 insertions(+), 1 deletions(-) - *Diffs* ------------------------------------------------------------- - *commit* a7118333b4e5d2a116404f4be58e647d49f36815 - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Wed Sep 25 18:10:50 2013 +0200 Subject: JointInterface: add velocity field src/libs/interfaces/JointInterface.cpp | 38 +++++++++++++++++++++++++++++++- src/libs/interfaces/JointInterface.h | 6 +++++ src/libs/interfaces/JointInterface.xml | 3 ++ 3 files changed, 46 insertions(+), 1 deletions(-) _Diff for modified files_: diff --git a/src/libs/interfaces/JointInterface.cpp b/src/libs/interfaces/JointInterface.cpp index 7aab9e5..ee0d014 100644 --- a/src/libs/interfaces/JointInterface.cpp +++ b/src/libs/interfaces/JointInterface.cpp @@ -49,7 +49,8 @@ JointInterface::JointInterface() : Interface() data_ts = (interface_data_ts_t *)data_ptr; memset(data_ptr, 0, data_size); add_fieldinfo(IFT_FLOAT, "position", 1, &data->position); - unsigned char tmp_hash[] = {0xbf, 0xba, 0x71, 0x8c, 0x87, 0x2e, 0xe9, 0xfb, 0xfb, 0xb6, 0x8a, 0x12, 0xb0, 0x95, 0x6a, 0xa1}; + add_fieldinfo(IFT_FLOAT, "velocity", 1, &data->velocity); + unsigned char tmp_hash[] = {0xd2, 0x74, 0x1b, 0x6a, 0x5b, 0xf, 0xa9, 0xe1, 0xb0, 0xa8, 0x47, 0x84, 0x6f, 0x8f, 0x1c, 0xab}; set_hash(tmp_hash); } @@ -94,6 +95,41 @@ JointInterface::set_position(const float new_position) data_changed = true; } +/** Get velocity value. + * + The joint's velocity in rad/s. + + * @return velocity value + */ +float +JointInterface::velocity() const +{ + return data->velocity; +} + +/** Get maximum length of velocity value. + * @return length of velocity value, can be length of the array or number of + * maximum number of characters for a string + */ +size_t +JointInterface::maxlenof_velocity() const +{ + return 1; +} + +/** Set velocity value. + * + The joint's velocity in rad/s. + + * @param new_velocity new velocity value + */ +void +JointInterface::set_velocity(const float new_velocity) +{ + data->velocity = new_velocity; + data_changed = true; +} + /* =========== message create =========== */ Message * JointInterface::create_message(const char *type) const diff --git a/src/libs/interfaces/JointInterface.h b/src/libs/interfaces/JointInterface.h index c370607..9290623 100644 --- a/src/libs/interfaces/JointInterface.h +++ b/src/libs/interfaces/JointInterface.h @@ -47,6 +47,9 @@ class JointInterface : public Interface float position; /**< The joint's position in rad. */ + float velocity; /**< + The joint's velocity in rad/s. + */ } JointInterface_data_t; #pragma pack(pop) @@ -64,6 +67,9 @@ class JointInterface : public Interface float position() const; void set_position(const float new_position); size_t maxlenof_position() const; + float velocity() const; + void set_velocity(const float new_velocity); + size_t maxlenof_velocity() const; virtual Message * create_message(const char *type) const; virtual void copy_values(const Interface *other); diff --git a/src/libs/interfaces/JointInterface.xml b/src/libs/interfaces/JointInterface.xml index f68fbd0..ab85b7d 100644 --- a/src/libs/interfaces/JointInterface.xml +++ b/src/libs/interfaces/JointInterface.xml @@ -8,5 +8,8 @@ <field type="float" name="position"> The joint's position in rad. </field> + <field type="float" name="velocity"> + The joint's velocity in rad/s. + </field> </data> </interface> - *commit* 6a6a50af95c2271dc29e57659cdaba4a13524e3b - - - - - - - - - - Author: Till Hofmann <hofm...@kbsg.rwth-aachen.de> Date: Wed Sep 25 18:11:51 2013 +0200 Subject: pantilt: write the joints' velocities to the JointInterfaces src/plugins/pantilt/robotis/rx28_thread.cpp | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) _Diff for modified files_: diff --git a/src/plugins/pantilt/robotis/rx28_thread.cpp b/src/plugins/pantilt/robotis/rx28_thread.cpp index 30f25d6..cd45a7c 100644 --- a/src/plugins/pantilt/robotis/rx28_thread.cpp +++ b/src/plugins/pantilt/robotis/rx28_thread.cpp @@ -179,11 +179,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->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->write(); __wt = new WorkerThread(__ptu_name, logger, __rx28, @@ -290,9 +292,11 @@ PanTiltRX28Thread::update_sensor_values() __pantilt_if->write(); __panjoint_if->set_position(pan); + __panjoint_if->set_velocity(panvel); __panjoint_if->write(); __tiltjoint_if->set_position(tilt); + __tiltjoint_if->set_velocity(tiltvel); __tiltjoint_if->write(); #ifdef HAVE_TF -- 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