Hi All,
I’m developing an app in C# using a class based on the C# Wrapper (XArmAPI.cs).
I want to demonstrate the reduced mode for my students so my computer setup is :
- Detection sensor on serial => in C# event DataReceived
- Loop (x5) Motion between 2 poses where arm should go in reduced mode
I want to see the speed change when the sensor is activated and the flag HumanIn is set to true.
Some pieces of code:
- xARM reset and Max Speed definition
xARM.Reset(); xARM.SetReducedMaxTCPSpeed(500.0F);
- Serial event code
// Cobot RS232 Interrupt
if (rs232.StartsWith(“E”))
{
HumanIn = !HumanIn;
if (xARM.IsCreated() && xARM.IsEnableMotion())
{
if (HumanIn)
xARM.ActivateReducedMode(true);
else
xARM.ActivateReducedMode(false);
}
}
As I can’t see the speed changes then I modify my code to test the HumanIn flag state toggle with the code below:
// Loop
if (xARM.IsCreated() && xARM.IsEnableMotion())
{
for (int i = 0; i < 5; i++)
{
if (HumanIn)
i = 5;
xARM.MoveBase(pose1, radius, speed, acc, mvtime, wait, timeout, relative, motion_type);
// Update GUI
buttonGetJoint_Click(sender, e);
buttonGetPosition_Click(sender, e);
xARM.MoveBase(pose2, radius, speed, acc, mvtime, wait, timeout, relative, motion_type);
// Update GUI
buttonGetJoint_Click(sender, e);
buttonGetPosition_Click(sender, e);
}
if (HumanIn)
{
xARM.MoveHome(0, 0, 0, true);
// Update GUI
buttonGetJoint_Click(sender, e);
buttonGetPosition_Click(sender, e);
}
else
{
xARM.MoveBase(pose1, true);
// Update GUI
buttonGetJoint_Click(sender, e);
buttonGetPosition_Click(sender, e);
}
}
The result is OK => the flag goes to true => the loop is stopped => Robot goes to Home
Now to setup the reduced mode, some questions:
Q1) How the setup the “normal” TCP Speed for all “MoveBase” (same as setPosition in XArmAPI )?
In most of the code sample, in setPosition, speed is set to default value = 0.
Q2) Is it possible to enable or disable the Reduced Mode while arm is in motion ?
Regards.
Olivier.
UFACTORY Website
Official Store
uArm User Facebook Group
Feedback:
English Channel
中文通道