|
From: <rob...@us...> - 2009-03-09 19:51:32
|
Revision: 12301
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=12301&view=rev
Author: rob_wheeler
Date: 2009-03-09 19:50:56 +0000 (Mon, 09 Mar 2009)
Log Message:
-----------
Report the ethercat device position in the mechanism state message
Modified Paths:
--------------
pkg/trunk/drivers/motor/ethercat_hardware/src/wg0x.cpp
pkg/trunk/mechanism/hardware_interface/include/hardware_interface/hardware_interface.h
pkg/trunk/mechanism/mechanism_control/scripts/detect.py
pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
pkg/trunk/prcore/robot_msgs/msg/ActuatorState.msg
Modified: pkg/trunk/drivers/motor/ethercat_hardware/src/wg0x.cpp
===================================================================
--- pkg/trunk/drivers/motor/ethercat_hardware/src/wg0x.cpp 2009-03-09 19:40:22 UTC (rev 12300)
+++ pkg/trunk/drivers/motor/ethercat_hardware/src/wg0x.cpp 2009-03-09 19:50:56 UTC (rev 12301)
@@ -361,6 +361,7 @@
prev_status = (WG0XStatus *)prev_buffer;
state.timestamp_ = this_status->timestamp_ / 1e+6;
+ state.device_id_ = sh_->get_ring_position();
state.encoder_count_ = this_status->encoder_count_;
state.position_ = double(this_status->encoder_count_) / actuator_info_.pulses_per_revolution_ * 2 * M_PI - state.zero_offset_;
state.encoder_velocity_ = double(int(this_status->encoder_count_ - prev_status->encoder_count_))
Modified: pkg/trunk/mechanism/hardware_interface/include/hardware_interface/hardware_interface.h
===================================================================
--- pkg/trunk/mechanism/hardware_interface/include/hardware_interface/hardware_interface.h 2009-03-09 19:40:22 UTC (rev 12300)
+++ pkg/trunk/mechanism/hardware_interface/include/hardware_interface/hardware_interface.h 2009-03-09 19:50:56 UTC (rev 12301)
@@ -58,6 +58,7 @@
public:
ActuatorState() :
timestamp_(0),
+ device_id_(0),
encoder_count_(0),
position_(0),
encoder_velocity_(0),
@@ -81,6 +82,8 @@
{}
double timestamp_;
+ int device_id_;
+
int encoder_count_;
double position_;
double encoder_velocity_;
Modified: pkg/trunk/mechanism/mechanism_control/scripts/detect.py
===================================================================
--- pkg/trunk/mechanism/mechanism_control/scripts/detect.py 2009-03-09 19:40:22 UTC (rev 12300)
+++ pkg/trunk/mechanism/mechanism_control/scripts/detect.py 2009-03-09 19:50:56 UTC (rev 12301)
@@ -17,7 +17,7 @@
def callback(data):
#stdscr.clear()
- l = [(x, data.actuator_states[x].encoder_count, data.actuator_states[x].encoder_velocity, data.actuator_states[x].name) for x in xrange(len(data.actuator_states))]
+ l = [(data.actuator_states[x].device_id, data.actuator_states[x].encoder_count, data.actuator_states[x].encoder_velocity, data.actuator_states[x].name) for x in xrange(len(data.actuator_states))]
m = list(l)
m.sort(mycmp)
row = 0
Modified: pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp
===================================================================
--- pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2009-03-09 19:40:22 UTC (rev 12300)
+++ pkg/trunk/mechanism/mechanism_control/src/mechanism_control.cpp 2009-03-09 19:50:56 UTC (rev 12301)
@@ -507,6 +507,7 @@
out->encoder_count = in->encoder_count_;
out->position = in->position_;
out->timestamp = in->timestamp_;
+ out->device_id = in->device_id_;
out->encoder_velocity = in->encoder_velocity_;
out->velocity = in->velocity_;
out->calibration_reading = in->calibration_reading_;
Modified: pkg/trunk/prcore/robot_msgs/msg/ActuatorState.msg
===================================================================
--- pkg/trunk/prcore/robot_msgs/msg/ActuatorState.msg 2009-03-09 19:40:22 UTC (rev 12300)
+++ pkg/trunk/prcore/robot_msgs/msg/ActuatorState.msg 2009-03-09 19:50:56 UTC (rev 12301)
@@ -1,4 +1,5 @@
string name
+int32 device_id
int32 encoder_count
float64 position
float64 timestamp
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|