Eric Coughlin I filed this ticket when you reported to me that the Hexapod was not enforcing position limits after restricting the limits via the configureLimits. I am now looking at the code and I'm not sure how this can be happening. I would like more input from you.
Here is the relevant bit of code for move in hexapod_csc.py:
def _make_position_set_command(self, data):
|
"""Make a POSITION_SET command for the low-level controller
|
using data from the move or moveLUT CSC command.
|
"""
|
utils.check_symmetrical_range(data.x, "x", self.server.config.pos_limits[0],
|
ExceptionClass=salobj.ExpectedError)
|
utils.check_symmetrical_range(data.y, "y", self.server.config.pos_limits[0],
|
ExceptionClass=salobj.ExpectedError)
|
utils.check_range(data.z, "z", self.server.config.pos_limits[1],
|
self.server.config.pos_limits[2],
|
ExceptionClass=salobj.ExpectedError)
|
utils.check_symmetrical_range(data.u, "u", self.server.config.pos_limits[3],
|
ExceptionClass=salobj.ExpectedError)
|
utils.check_symmetrical_range(data.v, "v", self.server.config.pos_limits[3],
|
ExceptionClass=salobj.ExpectedError)
|
utils.check_range(data.w, "w", self.server.config.pos_limits[4],
|
self.server.config.pos_limits[5],
|
ExceptionClass=salobj.ExpectedError)
|
return self.make_command(code=enums.CommandCode.POSITION_SET,
|
param1=data.x,
|
param2=data.y,
|
param3=data.z,
|
param4=data.u,
|
param5=data.v,
|
param6=data.w)
|
self.server.config is updated whenever configuration is changed, and the current position limits are self.server.config.pos_limits.
Note that it may take a fraction of a second for the low-level controller to report the new configuration. Until this occurs (and the CSC parses it) the old limits will be checked in the CSC. So if you were trying sending the setLimits command immediately followed by the move or offset command, then the problem may be a race condition. If so, I suspect it is not worth the complexity to try to fix it (at least not without replacing the low-level controller). It would require a lot of complex code to fix this, setting our own limits is rare, and the low level controller will protect itself.
Offsets use a very similar bit of code, but the offset is first supplemented by self.server.telemetry.commanded_pos to obtain an absolute position. So if you only see this problem with the offset command then it may be another problem. If you only see the problem with offset then please run the following test: command some moves and see if the demand field of the application event accurately reports the new commanded positions.
If none of the above then I would appreciate more information, including some logs showing the commanded position and reported configuration and application event output.
Eric Coughlin I filed this ticket when you reported to me that the Hexapod was not enforcing position limits after restricting the limits via the configureLimits. I am now looking at the code and I'm not sure how this can be happening. I would like more input from you.
Here is the relevant bit of code for move in hexapod_csc.py:
def _make_position_set_command(self, data):
"""Make a POSITION_SET command for the low-level controller
using data from the move or moveLUT CSC command.
"""
utils.check_symmetrical_range(data.x, "x", self.server.config.pos_limits[0],
ExceptionClass=salobj.ExpectedError)
utils.check_symmetrical_range(data.y, "y", self.server.config.pos_limits[0],
ExceptionClass=salobj.ExpectedError)
utils.check_range(data.z, "z", self.server.config.pos_limits[1],
self.server.config.pos_limits[2],
ExceptionClass=salobj.ExpectedError)
utils.check_symmetrical_range(data.u, "u", self.server.config.pos_limits[3],
ExceptionClass=salobj.ExpectedError)
utils.check_symmetrical_range(data.v, "v", self.server.config.pos_limits[3],
ExceptionClass=salobj.ExpectedError)
utils.check_range(data.w, "w", self.server.config.pos_limits[4],
self.server.config.pos_limits[5],
ExceptionClass=salobj.ExpectedError)
return self.make_command(code=enums.CommandCode.POSITION_SET,
param1=data.x,
param2=data.y,
param3=data.z,
param4=data.u,
param5=data.v,
param6=data.w)
self.server.config is updated whenever configuration is changed, and the current position limits are self.server.config.pos_limits.
Note that it may take a fraction of a second for the low-level controller to report the new configuration. Until this occurs (and the CSC parses it) the old limits will be checked in the CSC. So if you were trying sending the setLimits command immediately followed by the move or offset command, then the problem may be a race condition. If so, I suspect it is not worth the complexity to try to fix it (at least not without replacing the low-level controller). It would require a lot of complex code to fix this, setting our own limits is rare, and the low level controller will protect itself.
Offsets use a very similar bit of code, but the offset is first supplemented by self.server.telemetry.commanded_pos to obtain an absolute position. So if you only see this problem with the offset command then it may be another problem. If you only see the problem with offset then please run the following test: command some moves and see if the demand field of the application event accurately reports the new commanded positions.
If none of the above then I would appreciate more information, including some logs showing the commanded position and reported configuration and application event output.