|
From: <rdi...@us...> - 2009-02-04 01:58:39
|
Revision: 10516
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=10516&view=rev
Author: rdiankov
Date: 2009-02-04 01:58:35 +0000 (Wed, 04 Feb 2009)
Log Message:
-----------
removed underscores from rosoct names for matlab compat
Modified Paths:
--------------
pkg/trunk/calibration/laser_camera_calibration/octave/startgathering.m
pkg/trunk/openrave_planning/openraveros/octave/openraveros_destroysession.m
pkg/trunk/util/filter_coefficient_server/scripts/filter_coeff_server.m
Modified: pkg/trunk/calibration/laser_camera_calibration/octave/startgathering.m
===================================================================
--- pkg/trunk/calibration/laser_camera_calibration/octave/startgathering.m 2009-02-04 01:48:37 UTC (rev 10515)
+++ pkg/trunk/calibration/laser_camera_calibration/octave/startgathering.m 2009-02-04 01:58:35 UTC (rev 10516)
@@ -6,7 +6,7 @@
%% by Rosen Diankov
function calibdata = startgathering(robot)
-global lastobjdet lastlaserscan lastmecstate __calibdata __iterationcount
+global lastobjdet lastlaserscan lastmecstate g_calibdata g_iterationncount
if( ~exist('robot') )
robot = [];
@@ -17,24 +17,24 @@
rosoct_add_msgs('robot_msgs');
queuesize = 1000; % need big buffer
-__calibdata = {};
+g_calibdata = {};
lastobjdet = {};
-__iterationcount = 0;
-__rosoct_msg_unsubscribe("new_ObjectDetection");
+g_iterationncount = 0;
+rosoct_unsubscribe("new_ObjectDetection");
success = rosoct_subscribe("new_ObjectDetection", @checkerboard_detector_ObjectDetection, @(msg) objdetcb(msg,robot),queuesize);
if( ~success )
error('subscribe failed');
end
lastlaserscan = {};
-__rosoct_msg_unsubscribe("new_tile_scan");
+rosoct_unsubscribe("new_tile_scan");
success = rosoct_subscribe("new_tilt_scan", @std_msgs_LaserScan, @(msg) laserscancb(msg,robot),queuesize);
if( ~success )
error('subscribe failed');
end
lastmecstate = {};
-__rosoct_msg_unsubscribe("new_mechanism_state");
+rosoct_unsubscribe("new_mechanism_state");
success = rosoct_subscribe("new_mechanism_state", @robot_msgs_MechanismState, @(msg) mecstatecb(msg,robot),queuesize);
if( ~success )
error('subscribe failed');
@@ -44,21 +44,21 @@
input('press any key after data is started streaming: ');
while(1)
pause(0.1);
- numprocessed = __rosoct_worker(1);
- if( numprocessed == 0 && __iterationcount > 0 )
+ numprocessed = rosoct_worker(1);
+ if( numprocessed == 0 && g_iterationncount > 0 )
display('stream done');
break;
end
end
-__rosoct_msg_unsubscribe("new_ObjectDetection");
-__rosoct_msg_unsubscribe("new_tile_scan");
-__rosoct_msg_unsubscribe("new_mechanism_state");
+rosoct_unsubscribe("new_ObjectDetection");
+rosoct_unsubscribe("new_tile_scan");
+rosoct_unsubscribe("new_mechanism_state");
-display(sprintf('gathering calibration done, total extracted: %d, total parsed: %d', length(__calibdata), __iterationcount));
-calibdata = __calibdata;
+display(sprintf('gathering calibration done, total extracted: %d, total parsed: %d', length(g_calibdata), g_iterationncount));
+calibdata = g_calibdata;
save calibdata.mat calibdata
-__calibdata = {};
+g_calibdata = {};
function objdetcb(msg, robot)
global lastobjdet
@@ -79,7 +79,7 @@
equal = stamp1.sec==stamp2.sec & abs(stamp1.nsec-stamp2.nsec)<0.001;
function gathermsgs(robot)
-global lastobjdet lastlaserscan lastmecstate __calibdata __iterationcount
+global lastobjdet lastlaserscan lastmecstate g_calibdata g_iterationncount
if( length(lastobjdet) == 0 || length(lastlaserscan) == 0 || length(lastmecstate) == 0 )
return;
@@ -98,7 +98,7 @@
lastlaserscan(1) = [];
lastmecstate(1) = [];
-__iterationcount = __iterationcount + 1;
+g_iterationncount = g_iterationncount + 1;
data = [];
rawjointvalues = cellfun(@(x) x.position, mecstatemsg.joint_states);
if( ~isempty(robot) )
@@ -193,5 +193,5 @@
plot(laserline([1 3]),laserline([2 4]),'r','linewidth',5); drawnow;
data.laserline = laserline;
-__calibdata{end+1} = data;
-display(sprintf('adding data %d', length(__calibdata)));
+g_calibdata{end+1} = data;
+display(sprintf('adding data %d', length(g_calibdata)));
Modified: pkg/trunk/openrave_planning/openraveros/octave/openraveros_destroysession.m
===================================================================
--- pkg/trunk/openrave_planning/openraveros/octave/openraveros_destroysession.m 2009-02-04 01:48:37 UTC (rev 10515)
+++ pkg/trunk/openrave_planning/openraveros/octave/openraveros_destroysession.m 2009-02-04 01:58:35 UTC (rev 10516)
@@ -42,7 +42,7 @@
end
%% destroys all the sessions of a session server
-__rosoct_terminate_session(session.id);
+rosoct_terminate_session(session.id);
%% if this is the global session, make sure to propagate the changes
if( ~isempty(gsession) && session.id == gsession.id )
Modified: pkg/trunk/util/filter_coefficient_server/scripts/filter_coeff_server.m
===================================================================
--- pkg/trunk/util/filter_coefficient_server/scripts/filter_coeff_server.m 2009-02-04 01:48:37 UTC (rev 10515)
+++ pkg/trunk/util/filter_coefficient_server/scripts/filter_coeff_server.m 2009-02-04 01:58:35 UTC (rev 10516)
@@ -36,7 +36,7 @@
addpath(fullfile(rosoctpath, '/scripts'));
startup;
-__rosoct_unadvertise_service('filter_coeffs');
+rosoct_unadvertise_service('filter_coeffs');
% Creates the service
suc = rosoct_advertise_service('filter_coeffs',@filter_coefficient_server_Filter,@filterserv);
@@ -46,5 +46,5 @@
% Loops to keep the octave session going
while(1)
- __rosoct_worker();
+ rosoct_worker();
end
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|