Skip to content
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

Merged
merged 6 commits into from
Jun 28, 2018
Merged

MotoROS v1.8.1 #227

merged 6 commits into from
Jun 28, 2018

Conversation

gavanderhoorn
Copy link
Member

See commit comments.

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.
@gavanderhoorn
Copy link
Member Author

@EricMarcil: fyi.

@gavanderhoorn
Copy link
Member Author

Note that we'll need to update the links on the wiki again after this gets merged (because of the new binaries). See #220.

Copy link
Member Author

@gavanderhoorn gavanderhoorn left a 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);
}
}

Copy link
Member Author

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.

Copy link
Contributor

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;
Copy link
Member Author

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?

Copy link
Contributor

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));
Copy link
Member Author

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);
Copy link
Member Author

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?

Copy link
Member Author

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.

Copy link
Contributor

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;
Copy link
Member Author

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)
Copy link
Member Author

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 returns)? Seeing an else if in isolation without an else always looks weird to me.

Copy link
Contributor

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.

@gavanderhoorn
Copy link
Member Author

Checked this on our SIA20F+linear rail.

This PR definitely improves the in_motion situation. in_motion stays true for the majority of the motion, and then goes to false three (3) JointFeedback messages before the robot has come to a complete stop. Joint velocity is also > 0 for the three JointFeedback messages after in_motion has changed to false.

I haven't checked, but that could well be within the START_MAX_PULSE_DEVIATION that @EricMarcil mentions in #219 (comment) (robot was moving rather slowly along the rail, and 3 msgs at 50 Hz is 75ms).

@gavanderhoorn
Copy link
Member Author

@EricMarcil: I've added some comments.

@gavanderhoorn
Copy link
Member Author

@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.

@andreaskoepf
Copy link
Contributor

@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.)

@gavanderhoorn
Copy link
Member Author

@andreaskoepf wrote:

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.)

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.

@gavanderhoorn
Copy link
Member Author

gavanderhoorn commented Jun 28, 2018

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.

@gavanderhoorn
Copy link
Member Author

@EricMarcil: as this PR was opened by me, I need one other maintainer to review this PR and approve it. Could you do that?

@gavanderhoorn gavanderhoorn merged commit 7de2511 into kinetic-devel Jun 28, 2018
@gavanderhoorn gavanderhoorn deleted the motoros181 branch June 28, 2018 14:21
@gavanderhoorn
Copy link
Member Author

Thanks for the review @EricMarcil 👍

gavanderhoorn added a commit to gavanderhoorn/motoman that referenced this pull request Aug 9, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants