Beispiel #1
0
            public override void Randomize()
            {
                int    arraylength = -1;
                Random rand        = new Random();
                int    strlength;

                byte[] strbuf, myByte;

                //model_name
                strlength = rand.Next(100) + 1;
                strbuf    = new byte[strlength];
                rand.NextBytes(strbuf);  //fill the whole buffer with random bytes
                for (int __x__ = 0; __x__ < strlength; __x__++)
                {
                    if (strbuf[__x__] == 0) //replace null chars with non-null random ones
                    {
                        strbuf[__x__] = (byte)(rand.Next(254) + 1);
                    }
                }
                strbuf[strlength - 1] = 0; //null terminate
                model_name            = Encoding.ASCII.GetString(strbuf);
                //joint_trajectory
                joint_trajectory = new Messages.trajectory_msgs.JointTrajectory();
                joint_trajectory.Randomize();
                //model_pose
                model_pose = new Pose();
                model_pose.Randomize();
                //set_model_pose
                set_model_pose = rand.Next(2) == 1;
                //disable_physics_updates
                disable_physics_updates = rand.Next(2) == 1;
            }
Beispiel #2
0
            public override void Randomize()
            {
                int    arraylength = -1;
                Random rand        = new Random();
                int    strlength;

                byte[] strbuf, myByte;

                //trajectory
                trajectory = new Messages.trajectory_msgs.JointTrajectory();
                trajectory.Randomize();
            }
Beispiel #3
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;


            //trajectory
            trajectory = new Messages.trajectory_msgs.JointTrajectory();
            trajectory.Randomize();
            //check_collision
            check_collision = rand.Next(2) == 1;
        }
            public override void Randomize()
            {
                int    arraylength = -1;
                Random rand        = new Random();
                int    strlength;

                byte[] strbuf, myByte;

                //solution
                solution = new Messages.trajectory_msgs.JointTrajectory();
                solution.Randomize();
                //error_code
                error_code = new Messages.moveit_msgs.MoveItErrorCodes();
                error_code.Randomize();
            }
Beispiel #5
0
        public override void Randomize()
        {
            int    arraylength = -1;
            Random rand        = new Random();
            int    strlength;

            byte[] strbuf, myByte;

            //trajectory
            trajectory = new Messages.trajectory_msgs.JointTrajectory();
            trajectory.Randomize();
            //path_tolerance
            arraylength = rand.Next(10);
            if (path_tolerance == null)
            {
                path_tolerance = new Messages.control_msgs.JointTolerance[arraylength];
            }
            else
            {
                Array.Resize(ref path_tolerance, arraylength);
            }
            for (int i = 0; i < path_tolerance.Length; i++)
            {
                //path_tolerance[i]
                path_tolerance[i] = new Messages.control_msgs.JointTolerance();
                path_tolerance[i].Randomize();
            }
            //goal_tolerance
            arraylength = rand.Next(10);
            if (goal_tolerance == null)
            {
                goal_tolerance = new Messages.control_msgs.JointTolerance[arraylength];
            }
            else
            {
                Array.Resize(ref goal_tolerance, arraylength);
            }
            for (int i = 0; i < goal_tolerance.Length; i++)
            {
                //goal_tolerance[i]
                goal_tolerance[i] = new Messages.control_msgs.JointTolerance();
                goal_tolerance[i].Randomize();
            }
            //goal_time_tolerance
            goal_time_tolerance = new Duration(new TimeData(
                                                   Convert.ToUInt32(rand.Next()),
                                                   Convert.ToUInt32(rand.Next())));
        }