-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MotoROS v1.8.1 #227
MotoROS v1.8.1 #227
Conversation
Take execution status into account as well when determining the value for the 'in_motion' field of the Robot Status message.
This fixes velocities being reported by the driver for axes that are not part of the motion group.
This should only be applied when necessary, and DX200 and YRC1000 already decouple this earlier.
@EricMarcil: fyi. |
Note that we'll need to update the links on the wiki again after this gets merged (because of the new binaries). See #220. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested the new binaries yet, but here are some comments.
pulseSpeed[dest_axis] -= (int)(pulseSpeed[src_axis] * corr->fCorrectionRatio); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this for
be merged with the one directly above it? Would avoid iterating over the pulseSpeed
array again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you look closely, the axis correction makes reference to another source axis pulseSpeed. Granted that the source axis is normally a previous axis but there is a possibility that it wouldn't. So it is safer to calculate the pulseSpeed for all axes before doing the correction.
{ | ||
//Check group number valid | ||
if (!Ros_Controller_IsValidGroupNo(controller, groupNo)) | ||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just checking: if all groupNo
are invalid, it immediately means that this function returns FALSE
. I'm not sure a robot with all groups being invalid can be in motion, but this is on purpose, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is correct and intentional. If all groups are invalid, there really nothing to move.
@@ -455,6 +457,8 @@ BOOL Ros_CtrlGroup_GetTorque(CtrlGroup* ctrlGroup, double torqueValues[MAX_PULSE | |||
memset(dst_trq.data, 0, sizeof(MP_TRQCTL_DATA)); | |||
dst_trq.unit = TRQ_NEWTON_METER; //request data in Nm | |||
|
|||
memset(&dst_vel, 0x00, sizeof(MP_GRP_AXES_T)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: the memset(..)
above this one uses a plain, decimal, 0
.
@@ -97,6 +97,7 @@ void Ros_IoServer_StartNewConnection(Controller* controller, int sd) | |||
controller->sdIoConnections[connectionIndex] = INVALID_SOCKET; | |||
controller->tidIoConnections[connectionIndex] = INVALID_TASK; | |||
Ros_Controller_SetIOState(IO_FEEDBACK_FAILURE, TRUE); | |||
mpSetAlarm(8004, "MOTOROS FAILED TO CREATE TASK", 7); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the 7
a nr with a special significance? Fi, 7
indicates the IoServer task could not be created?
If so: should we create constants for them, to avoid the magic nrs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the same comment for the other mpSetAlarm(..)
invocations for task creation failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've given each mpSetAlarm a different subcode (pretty much in the order they are created), so that if the alarm 8004 occurs, it could help identify which task wasn't started. Generally speaking, I doubt that we would dig down to that level because whenever that 8004 occurs, it's probably because of parameters settings or you have multiple versions of the MotoRos running. So I didn't go as far as creating constants for them.
@@ -1552,7 +1556,7 @@ int Ros_MotionServer_GetQueueCnt(Controller* controller, int groupNo) | |||
} | |||
|
|||
printf("ERROR: Unable to access queue count. Queue is locked up!\r\n"); | |||
return -1; | |||
return ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
return TRUE; | ||
else if (qCnt == ERROR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be just an if
, right (because of the return
s)? Seeing an else if
in isolation without an else
always looks weird to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it could. That change was made by @ted-miller. Personally, I tend to build the if, else if, else structure based on the conditions that is to be consider (in this case the qCnt value). It's independently of what occurs after the condition is identified. So I tend to agree with the way it is.
Checked this on our SIA20F+linear rail. This PR definitely improves the I haven't checked, but that could well be within the |
@EricMarcil: I've added some comments. |
@alemme / @andreaskoepf: do you see any chance of testing fe26038 perhaps on your SDA? It would seem to address at least some of the comments by @andreaskoepf in #219. |
@EricMarcil Great to see some improvements here! @gavanderhoorn We will defiintely test this during the next two weeks. (Currently we are in final preparations for Rosvita v0 release (which hopefully will be the best or one of the best ROS GUIs for controlling the SDA). I plan to sync our Motoman driver with this repo in the July timeframe.) |
@andreaskoepf wrote:
Ok, good. In the meantime I'll go ahead and merge this, as it solves some of the other issues we have with goals being flagged as completed too early. If anything pops up during your testing please open a new issue. |
I'm not in the habit of doing this btw, but the test in this case would be in addition to the verification that has already been done by me and @ted-miller and @EricMarcil (at Motoman), and is also more a test to see whether the situation that you described in #219 has improved. |
@EricMarcil: as this PR was opened by me, I need one other maintainer to review this PR and approve it. Could you do that? |
Thanks for the review @EricMarcil 👍 |
Overload is not used by any part of the JTA. Additionally, it was checking only the status of the fourth motion group, which is not a correct way to determine motion completion for the entire robot (at least not until 'in_motion' was fixed in ros-industrial#227). If needed, we can bring it back by reverting this commit.
See commit comments.