Motion Target Reachable or not

Hello,

I have a 6-DOF robot mounted on an X-axis linear track. I am automatically generating IJoint/ ILinear motion statements using .NET, but some target positions are unreachable or cause singularities.

When I move the robot along the track, I can resolve these reachability and singularity issues. Therefore, I am trying to use IMotionTarget to detect these problematic points and adjust the value of the external axis accordingly. However, I am having difficulty determining exactly when and where to modify the external axis value.

my code :slight_smile:
for (int i = 0; i < 40; i++)
{

            IMotionTarget mt = robCont.CreateTarget();


            mt.SetExternalJointValues(new double\[\] { i \* 100.0 });

            mt.TargetMode = TargetMode.World;
            mt.MotionType = MotionType.Joint;
            mt.TargetMatrix = approachMatrix;

            mt.ToolName = robCont.Tools\[2\].Name;
            mt.BaseName = robCont.Bases\[0\].Name;

            mt.CurrentConfiguration = 0; // Test with default configuration
            if ((mt.Status & PositionStatus.Reachable) != 0)
            {
                RoUtils.PrintMsg($"IsReachable  {mt.IsStatusValid}");
            }

            if ((mt.Status & PositionStatus.WithinJointLimits) != 0)
            {
                msg.AppendMessage($"with joint limits",MessageLevel.Info);
            }

            if ((mt.Status & PositionStatus.NoSingularity) != 0)
            {
                msg.AppendMessage($"singularity", MessageLevel.Info);
            }

            
            // RoUtils.PrintMsg($"IsReachable  {mt.IsStatusValid}");
            // msg.AppendMessage($"IsReachable  ");
            // We use PositionStatus.Valid, which means Reachable, No Singularities, and Within Limits!
            
        }