-
Notifications
You must be signed in to change notification settings - Fork 195
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
FSU Speed Limit Handling #542
FSU Speed Limit Handling #542
Conversation
This is the basic handling of FSU Speed Limit. Works for a single control group. Need to generalize for multiple control groups.
Added multiple control group support and debug statements
Updated prevPulsePosData for all control groups.
Added MotoRosYRC1u_,out so people can test without needing to compile from source code.
I'm not sure I fully understand this comment:
Is this accurate? I'm curious how smooth the motion would be on the "unlimited" axes. Though maybe not a big deal, given that speed is already limited to a presumably "safe" level.
I think that your changes just involve queue-management. They don't have any direct changes to the motion API behavior, right? If so, then DX100 should be fine.
Yes. Much-requested feature. |
motoman_driver/MotoPlus/mpMain.c
Outdated
@@ -57,6 +57,9 @@ void mpUsrRoot(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int a | |||
#ifdef DX100 | |||
Ros_Sleep(10000); // 10 sec. delay to enable DX100 system to complete initialization | |||
#endif | |||
#ifdef DEBUG | |||
Ros_Debug_Init(); |
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 is not actually needed. This function is called in Debug_BroadcastMsg
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.
OK, removed
@@ -31,6 +31,10 @@ | |||
|
|||
#include "MotoROS.h" | |||
|
|||
#ifdef DEBUG |
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.
I recommend removing this condition. The DEBUG
preprocessor was to protect against costly printf
commands. The udp-broadcast method is way more efficient. I think it's safe to allow these w/o also enabling the printf
.
@@ -41,8 +41,8 @@ | |||
|
|||
#include "MotoROS.h" | |||
|
|||
|
|||
#ifdef DEBUG |
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.
Same as previous comment:
I recommend removing this condition. The
DEBUG
preprocessor was to protect against costlyprintf
commands. The udp-broadcast method is way more efficient. I think it's safe to allow these w/o also enabling theprintf
.
|
||
|
||
extern STATUS setsockopt(int s, int level, int optname, char* optval, int optlen); | ||
extern int mpNICData(USHORT if_no, ULONG* ip_addr, ULONG* subnet_mask, UCHAR* mac_addr, ULONG* default_gw); |
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 is YRC1000 (and micro) only. So you probably want a conditional flag around this whole file.
#define MP_USER_LAN2 2 /* general LAN interface2(only YRC1000) */ | ||
|
||
|
||
extern STATUS setsockopt(int s, int level, int optname, char* optval, int optlen); |
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.
We've got some stuff in the MotoROS2 project to obfuscate externs like this. We think it's probably portable to MotoROS1.
When you "skip" reading from the queue, is it selective on a per axis basis? If so, then I feel like that would cause the axes to get out of sync, resulting in a different TCP path. |
No the "skip" is per control group. It keep tracks of data for two cycles at the time and will keep skipping as long as the "previous" cycle is not completely processed for all axes. Then it moves the "current" cycle to the "previous" and allows reading of the next cycle from the incQueue. |
Change to support DX100
@EricMarcil: it's been some time since you opened this. Could you add a comment here clarifying the status of this PR? Thanks |
The MotoRos driver is read except for adding a new flag to indicate that the FSU is slowing the robot (which is easy to add once we agree on the format). |
yes, apologies. I was rather busy with other things.
Motoman is not the only OEM that does something like this. Some other OEMs with ROS drivers have implemented ways to notify the ROS side of events like this. We could see whether we could implement similar systems.
that's the more difficult part. MoveIt (or some other motion generating system) would have to be made aware of the changes to 'execution speed' and accommodate those. Conceptually, that's not that difficult. But someone will have to do the work. |
Hi @EricMarcil . I have implemented your changes in the MotoROS2 driver and tested it on HC10 robot. I have tested the behavior when FSU speed limit is active and remains constant during the whole process. The solution is working fine when trajectory is executed and always reaches the goal for simple trajectories. However, I have discovered a very dangerous behavior: in here the latest If the robot is manually moved and then switched back to remote mode, as soon as trajectory mode is enabled it starts moving to old position stored in |
Hi @iydv Also, I believe that the issue with |
Hi @iydv |
I have created an implementation of current solution for motoros2. I have introduced a way to fix described problem with |
I was able to reproduce the issue in two situations when the ROS commanded motion is restrained by the FSU Speed Limit:
I was under the impression that under those conditions that the MotionServer thread was being terminated and a new one would have to be started. But after verification, the motion command and motion buffer are cleared but the motion server thread keeps on running and moving the robot creates a difference between the current position and the previous position (introduce by this PR to track motion progress). So there are two options to fix this: |
…n control When the ROS commanded motion is restrained by the FSU Speed Limit, fixed unwanted motion after robot is moved by non-ROS means and then ROS motion is restarted.
@iydv I've committed a fix that corresponds to option 1 described above. Did you make changes on the Ros side for the MotoRos1 to manage the speed limit reduction, or only made changes for the MotoRos2? |
Added code to reset hasUnprocessedData state when Ros operation is interrupted.
I've reset the hasUnprocessedData variable as per comment on Yaskawa-Global/motoros2#157 (comment) |
Added comments to code to help developers understand what is being done.
Fix for multi-group support from correction made by Ted Miller on the MotoRos2 PR#157 Port FSU speed limit handling from MotoROS1
@EricMarcil: it looks like 961183a isn't the same as what Yaskawa-Global/motoros2@ |
Sorry about that. I rushed the change on Friday night so I would forget to do it the following week but ended up making bad cut/paste operation. I fixed it and tested on a single robot system. |
Yes. It'll be a few days though. I just reconfigured my system for Smart Pendant (single group). I need to get a few tasks done first. |
Yes, it appears to be working. Regarding my comment about the speed limit potentially not being applied to all groups: Yaskawa-Global/motoros2#157 (comment) I went ahead and disabled the FSU board for R1. So, R1 isn't limited. It turns out, your algorithm still "mostly" keeps the arms in sync. R1 appears to plow through it's increments at full speed, but it is prevented from getting new increments until R2 does. (I'll keep the video available for a few days, then will probably delete from my library.) |
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.
Need to update the binary names. Plus, make sure to update the APPLICATION_VERSION
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.
Removed binary. Will be added by separate commit.
Mainly modifications to use of the debug broadcast which only works on YRC1000/YRC1000micro controller.
@ted-miller Please review latest changes. |
These modifications to the MotoRos driver checks if the incremental pulses sent on the previous iteration matches the change in the robot command position. If it doesn't it means that the FSU Speed Limit is actively limiting the speed and rejecting some of the command.
By keeping track of the previous iterations values, the amount of increment processed is calculated and the unprocessed part is resent. When there is unprecessed pulses, we limit the reading of the incremental queue to one and then skip further reading until the previous increment is completely processed.
The speed associated with an increment is also track so that if the speed limit is removed, we don't send unprocessed pulses all at once and exceed the commanded speed.
This is still work in process but the basic functionality is working.
Need to test:
To Do: