Skip to content

Commit 775fc70

Browse files
committed
ini setting [JOINTS_n]UNITS not used (JA)
Notes: 1) joint values are dimensionless numbers 2) remove unused reading of ini setting [JOINTS_N]UNITS as the setting is not used in interpreter, task, motion, etc. 3) xyzabcuvw coordinates use: [TRAJ]LINEAR_UNITS [TRAJ]ANGULAR_UNITS as managed by the interpreter and required for startup 4) guis may have historical usage of [AXIS_L]UNITS but the settings are not processed by the base code (interpreter, task, motion, etc.)
1 parent 7c60ea8 commit 775fc70

File tree

16 files changed

+16
-260
lines changed

16 files changed

+16
-260
lines changed

docs/src/code/nml-messages.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ for details see src/emc/nml_intf/emc.hh
1111
JOINT
1212
----
1313
EMC_JOINT_SET_JOINT_TYPE
14-
EMC_JOINT_SET_UNITS_TYPE
1514
EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE
1615
EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE
1716
EMC_JOINT_SET_FERROR_TYPE

docs/src/code/nml-messages_es.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Para mas detalles, vea src/emc/nml_intf/emc.hh
1414
JOINT
1515
----
1616
EMC_JOINT_SET_JOINT_TYPE
17-
EMC_JOINT_SET_UNITS_TYPE
1817
EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE
1918
EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE
2019
EMC_JOINT_SET_FERROR_TYPE

docs/src/config/ini-config.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1121,11 +1121,6 @@ For more information on kinematics modules see the manpage: '$ man kins'
11211121
* 'TYPE = LINEAR' -
11221122
The type of joint, either LINEAR or ANGULAR.
11231123

1124-
* 'UNITS = INCH' -
1125-
(((UNITS))) If specified, this setting overrides the related [TRAJ] UNITS setting.
1126-
(e.g., [TRAJ]LINEAR_UNITS if the TYPE of this joint is LINEAR,
1127-
[TRAJ]ANGULAR_UNITS if the TYPE of this joint is ANGULAR)
1128-
11291124
* 'MAX_VELOCITY = 1.2' -
11301125
Maximum velocity for this joint in <<sec:traj-section,machine units>> per second.
11311126

docs/src/config/python-interface.txt

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,11 @@ of a particular axis:
404404
import linuxcnc
405405
s = linuxcnc.stat()
406406
s.poll()
407-
print "Joint 1 homed: ", s.joint[1]["homed"]
407+
# for trivkins where the axis indices 0,1,2 correspond to x,y,z:
408+
xidx=0;yidx=1;zidx=2
409+
print("Axis x max_position_limit: ", s.axis[xidx]["max_position_limit"])
410+
print("Axis y max_position_limit: ", s.axis[yidx]["max_position_limit"])
411+
print("Axis z max_position_limit: ", s.axis[zidx]["max_position_limit"])
408412
---------------------------------------------------------------------
409413

410414
Note that many properties that were formerly in the `axis` dictionary are
@@ -413,11 +417,11 @@ these items (such as backlash) are not the properties of an axis.
413417

414418
*max_position_limit*:: '(returns float)' -
415419
maximum limit (soft limit) for axis motion, in machine units.configuration
416-
parameter, reflects [JOINT_n]MAX_LIMIT.
420+
parameter, reflects [AXIS_n]MAX_LIMIT.
417421

418422
*min_position_limit*:: '(returns float)' -
419423
minimum limit (soft limit) for axis motion, in machine units.configuration
420-
parameter, reflects [JOINT_n]MIN_LIMIT.
424+
parameter, reflects [AXIS_n]MIN_LIMIT.
421425

422426
*velocity*:: '(returns float)' -
423427
current velocity.
@@ -427,7 +431,7 @@ current velocity.
427431
For each joint, the following dictionary keys are available:
428432

429433
*backlash*:: '(returns float)' -
430-
Backlash in machine units. configuration parameter, reflects [JOINT_n]BACKLASH.
434+
Backlash configuration parameter, reflects [JOINT_n]BACKLASH (dimensionless)
431435

432436
*enabled*:: '(returns integer)' -
433437
non-zero means enabled.
@@ -466,7 +470,7 @@ parameter, reflects [JOINT_n]FERROR.
466470
non-zero means max hard limit exceeded.
467471

468472
*max_position_limit*:: '(returns float)' -
469-
maximum limit (soft limit) for joint motion, in machine units. configuration
473+
maximum limit (soft limit) for joint motion (dimensionless). configuration
470474
parameter, reflects [JOINT_n]MAX_LIMIT.
471475

472476
*max_soft_limit*::
@@ -479,7 +483,7 @@ configuration parameter, reflects [JOINT_n]MIN_FERROR.
479483
non-zero means min hard limit exceeded.
480484

481485
*min_position_limit*:: '(returns float)' -
482-
minimum limit (soft limit) for joint motion, in machine units. configuration
486+
minimum limit (soft limit) for joint motion (dimensionless) configuration
483487
parameter, reflects [JOINT_n]MIN_LIMIT.
484488

485489
*min_soft_limit*:: '(returns integer)' -
@@ -491,11 +495,6 @@ commanded output position.
491495
*override_limits*:: '(returns integer)' -
492496
non-zero means limits are overridden.
493497

494-
*units*:: '(returns float)' -
495-
joint units per mm, or per degree for angular joints. +
496-
(joint units are the same as machine units, unless set otherwise
497-
by the configuration parameter [JOINT_n]UNITS)
498-
499498
*velocity*:: '(returns float)' -
500499
current velocity.
501500

docs/src/getting-started/updating-linuxcnc.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1285,6 +1285,10 @@ assertion of index_enable.
12851285

12861286
axis.py default for [DISPLAY]GEOMETRY was:"XYZBCUVW",is:"XYZABCUVW"
12871287

1288+
Removed unused [JOINT_n]UNITS and support in emcsh.cc,emcrsh.cc
1289+
emcmodule.cc (python-interface)
1290+
1291+
12881292
=== Code Updates
12891293

12901294
Management of the internal storage of tool data and the communication

src/emc/ini/inijoint.cc

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ extern value_inihal_data old_inihal_data;
5454
calls:
5555
5656
emcJointSetType(int joint, unsigned char jointType);
57-
emcJointSetUnits(int joint, double units);
5857
emcJointSetBacklash(int joint, double backlash);
5958
emcJointSetMinPositionLimit(int joint, double limit);
6059
emcJointSetMaxPositionLimit(int joint, double limit);
@@ -75,7 +74,6 @@ static int loadJoint(int joint, EmcIniFile *jointIniFile)
7574
char jointString[16];
7675
const char *inistring;
7776
EmcJointType jointType;
78-
double units;
7977
double backlash;
8078
double offset;
8179
double limit;
@@ -109,16 +107,6 @@ static int loadJoint(int joint, EmcIniFile *jointIniFile)
109107
return -1;
110108
}
111109

112-
// set units
113-
if(jointType == EMC_LINEAR){
114-
units = emcTrajGetLinearUnits();
115-
}else{
116-
units = emcTrajGetAngularUnits();
117-
}
118-
if (0 != emcJointSetUnits(joint, units)) {
119-
return -1;
120-
}
121-
122110
// set backlash
123111
backlash = 0; // default
124112
jointIniFile->Find(&backlash, "BACKLASH", jointString);

src/emc/nml_intf/emc.cc

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ int emcFormat(NMLTYPE type, void *buffer, CMS * cms)
132132
case EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE:
133133
((EMC_JOINT_SET_MIN_POSITION_LIMIT *) buffer)->update(cms);
134134
break;
135-
case EMC_JOINT_SET_UNITS_TYPE:
136-
((EMC_JOINT_SET_UNITS *) buffer)->update(cms);
137-
break;
138135
case EMC_JOINT_STAT_TYPE:
139136
((EMC_JOINT_STAT *) buffer)->update(cms);
140137
break;
@@ -537,8 +534,6 @@ const char *emc_symbol_lookup(uint32_t type)
537534
return "EMC_JOINT_SET_MIN_FERROR";
538535
case EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE:
539536
return "EMC_JOINT_SET_MIN_POSITION_LIMIT";
540-
case EMC_JOINT_SET_UNITS_TYPE:
541-
return "EMC_JOINT_SET_UNITS";
542537
case EMC_JOINT_STAT_TYPE:
543538
return "EMC_JOINT_STAT";
544539
case EMC_COOLANT_FLOOD_OFF_TYPE:
@@ -921,19 +916,6 @@ void EMC_MOTION_INIT::update(CMS * cms)
921916

922917
}
923918

924-
/*
925-
* NML/CMS Update function for EMC_JOINT_SET_UNITS
926-
* Automatically generated by NML CodeGen Java Applet.
927-
* on Sat Oct 11 13:45:16 UTC 2003
928-
*/
929-
void EMC_JOINT_SET_UNITS::update(CMS * cms)
930-
{
931-
932-
EMC_JOINT_CMD_MSG::update(cms);
933-
cms->update(units);
934-
935-
}
936-
937919
/*
938920
* NML/CMS Update function for EMC_SPINDLE_CONSTANT
939921
* Automatically generated by NML CodeGen Java Applet.
@@ -1802,7 +1784,6 @@ void EMC_JOINT_STAT::update(CMS * cms)
18021784

18031785
EMC_JOINT_STAT_MSG::update(cms);
18041786
cms->update(jointType);
1805-
cms->update(units);
18061787
cms->update(backlash);
18071788
cms->update(minPositionLimit);
18081789
cms->update(maxPositionLimit);

src/emc/nml_intf/emc.hh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ struct PM_CARTESIAN;
6161
// NML for EMC_JOINT
6262

6363
#define EMC_JOINT_SET_JOINT_TYPE ((NMLTYPE) 101)
64-
#define EMC_JOINT_SET_UNITS_TYPE ((NMLTYPE) 102)
6564
#define EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE ((NMLTYPE) 107)
6665
#define EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE ((NMLTYPE) 108)
6766
#define EMC_JOINT_SET_FERROR_TYPE ((NMLTYPE) 111)
@@ -351,7 +350,6 @@ extern int emcAxisUpdate(EMC_AXIS_STAT stat[], int numAxes);
351350
// implementation functions for EMC_JOINT types
352351

353352
extern int emcJointSetType(int joint, unsigned char jointType);
354-
extern int emcJointSetUnits(int joint, double units);
355353
extern int emcJointSetBacklash(int joint, double backlash);
356354
extern int emcJointSetMinPositionLimit(int joint, double limit);
357355
extern int emcJointSetMaxPositionLimit(int joint, double limit);

src/emc/nml_intf/emc_nml.hh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -204,24 +204,7 @@ class EMC_JOINT_SET_JOINT:public EMC_JOINT_CMD_MSG {
204204
};
205205

206206
/**
207-
* Set the units conversion factor.
208-
* @see EMC_JOINT_SET_INPUT_SCALE
209-
*/
210-
class EMC_JOINT_SET_UNITS:public EMC_JOINT_CMD_MSG {
211-
public:
212-
EMC_JOINT_SET_UNITS():EMC_JOINT_CMD_MSG(EMC_JOINT_SET_UNITS_TYPE,
213-
sizeof(EMC_JOINT_SET_UNITS)) {
214-
};
215-
216-
// For internal NML/CMS use only.
217-
void update(CMS * cms);
218-
219-
// units per mm, deg for linear, angular
220-
double units;
221-
};
222-
223-
/**
224-
* Set the Axis backlash.
207+
* Set the Joint backlash.
225208
* This command sets the backlash value.
226209
*/
227210
class EMC_JOINT_SET_BACKLASH:public EMC_JOINT_CMD_MSG {
@@ -514,7 +497,6 @@ class EMC_JOINT_STAT:public EMC_JOINT_STAT_MSG {
514497

515498
// configuration parameters
516499
unsigned char jointType; // EMC_JOINT_LINEAR, EMC_JOINT_ANGULAR
517-
double units; // units per mm, deg for linear, angular
518500
double backlash;
519501
double minPositionLimit;
520502
double maxPositionLimit;

src/emc/nml_intf/emcops.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ EMC_JOINT_STAT::EMC_JOINT_STAT():
2828
EMC_JOINT_STAT_MSG(EMC_JOINT_STAT_TYPE, sizeof(EMC_JOINT_STAT))
2929
{
3030
jointType = EMC_LINEAR;
31-
units = 1.0;
3231
backlash = 0.0;
3332
minPositionLimit = -1.0;
3433
maxPositionLimit = 1.0;

0 commit comments

Comments
 (0)