├── Docs ├── cv.jpg ├── pid.png ├── fig637_01.jpg ├── PID Control.pptx ├── Numpyrefresher.pdf ├── PID-Controller.png ├── drone-academy.jpg ├── Visual Odometry.pptx ├── Computer Vision-local.pptx ├── kalmanTrackingDemo_02.png └── Localization Using a Quad-Copter.pptx ├── Markers ├── a.png ├── b.png ├── c.png ├── d.png ├── nothing.png ├── Aruco markers - print! │ ├── outfile1.png │ ├── outfile10.png │ ├── outfile11.png │ ├── outfile12.png │ ├── outfile13.png │ ├── outfile14.png │ ├── outfile15.png │ ├── outfile16.png │ ├── outfile17.png │ ├── outfile18.png │ ├── outfile19.png │ ├── outfile2.png │ ├── outfile20.png │ ├── outfile3.png │ ├── outfile4.png │ ├── outfile5.png │ ├── outfile6.png │ ├── outfile7.png │ ├── outfile8.png │ ├── outfile9.png │ └── marker_make.py ├── marker detector program │ ├── RR-6303.pdf │ ├── testImg.jpg │ ├── testImg2.jpg │ ├── testImg3.jpg │ ├── outputFile3.png │ ├── homography_estimation.pdf │ ├── findH.py │ ├── findH4.py │ ├── findH2.py │ └── findH3.py └── whatwedowedo.py ├── UAV- localization ├── Ros simulator for ar drone │ └── rossim.txt ├── documentation │ ├── cv.jpg │ ├── pid.png │ ├── fig637_01.jpg │ ├── PID Control.pptx │ ├── drone-academy.jpg │ ├── Numpyrefresher.pdf │ ├── PID-Controller.png │ ├── Visual Odometry.pptx │ ├── Computer Vision-local.pptx │ ├── kalmanTrackingDemo_02.png │ └── Localization Using a Quad-Copter.pptx ├── Markers │ ├── Aruco markers - print! │ │ ├── outfile1.png │ │ ├── outfile2.png │ │ ├── outfile3.png │ │ ├── outfile4.png │ │ ├── outfile5.png │ │ ├── outfile6.png │ │ ├── outfile7.png │ │ ├── outfile8.png │ │ ├── outfile9.png │ │ ├── outfile10.png │ │ ├── outfile11.png │ │ ├── outfile12.png │ │ ├── outfile13.png │ │ ├── outfile14.png │ │ ├── outfile15.png │ │ ├── outfile16.png │ │ ├── outfile17.png │ │ ├── outfile18.png │ │ ├── outfile19.png │ │ ├── outfile20.png │ │ └── marker_make.py │ └── marker detector program │ │ ├── RR-6303.pdf │ │ ├── testImg.jpg │ │ ├── testImg2.jpg │ │ ├── testImg3.jpg │ │ ├── outputFile3.png │ │ ├── homography_estimation.pdf │ │ ├── findH.py │ │ ├── findH4.py │ │ ├── findH2.py │ │ └── findH3.py ├── came.py ├── PID Control │ └── PIDinitial.py ├── xcontrol.py └── teleop_drone.py ├── VREP QuadCopter Class ├── remoteApi.so ├── quadcopter_markers.ttt ├── test_quadcopter.py ├── Quadcopter.py ├── vrepConst.py └── vrep.py ├── Extended_testing ├── Trajectory 2 │ ├── contour │ │ ├── error_17.82707.npy │ │ ├── error_9.908949.npy │ │ ├── error_9.956183.npy │ │ ├── error_10.113866.npy │ │ ├── error_16.497101.npy │ │ ├── error_17.301278.npy │ │ ├── error_17.347898.npy │ │ ├── error_17.495717.npy │ │ ├── error_17.749991.npy │ │ └── error_18.286592.npy │ └── template │ │ ├── error_13.106892.npy │ │ ├── error_13.132654.npy │ │ ├── error_13.180408.npy │ │ ├── error_13.26363.npy │ │ ├── error_13.315284.npy │ │ ├── error_13.442899.npy │ │ ├── error_13.592966.npy │ │ ├── error_14.303803.npy │ │ ├── error_14.610141.npy │ │ └── error_14.638425.npy ├── Trajectory 3 │ ├── contour │ │ ├── error_8.435547.npy │ │ ├── error_10.070504.npy │ │ ├── error_10.494471.npy │ │ ├── error_15.904612.npy │ │ ├── error_15.910477.npy │ │ ├── error_16.229379.npy │ │ ├── error_16.487604.npy │ │ ├── error_17.563817.npy │ │ ├── error_18.151346.npy │ │ └── error_18.654254.npy │ └── template │ │ ├── error_12.787023.npy │ │ ├── error_12.933079.npy │ │ ├── error_13.070773.npy │ │ ├── error_13.641489.npy │ │ ├── error_13.928491.npy │ │ ├── error_14.104753.npy │ │ ├── error_14.393209.npy │ │ ├── error_14.456265.npy │ │ ├── error_15.265675.npy │ │ └── error_17.522199.npy └── Trajectory 1 │ ├── contour │ ├── error_67.045767.npy │ ├── error_67.284237.npy │ ├── error_67.328037.npy │ ├── error_67.336504.npy │ ├── error_67.517526.npy │ ├── error_67.595289.npy │ ├── error_67.746721.npy │ ├── error_67.750689.npy │ ├── error_67.899309.npy │ ├── error_68.024345.npy │ ├── error_68.543302.npy │ ├── error_68.685578.npy │ ├── error_68.763372.npy │ ├── error_68.772713.npy │ ├── error_68.827019.npy │ ├── error_69.320953.npy │ ├── error_69.389619.npy │ ├── error_70.271616.npy │ ├── error_70.744441.npy │ └── error_73.696263.npy │ └── template │ ├── error_64.262282.npy │ ├── error_64.359956.npy │ ├── error_65.231783.npy │ ├── error_65.596707.npy │ ├── error_65.671344.npy │ ├── error_65.746533.npy │ ├── error_65.823599.npy │ ├── error_66.097379.npy │ ├── error_66.430329.npy │ └── error_68.554352.npy ├── Report └── Preprocessing methods for Quadcopter Localization using Colored Markers - IEEE SocPaR 2016 - Springer.pdf ├── README.md └── Kalman KNN ├── knn.py ├── plotkal.py ├── contour_method.py └── KalmanFilter.py /Docs/cv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/cv.jpg -------------------------------------------------------------------------------- /Docs/pid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/pid.png -------------------------------------------------------------------------------- /Markers/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/a.png -------------------------------------------------------------------------------- /Markers/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/b.png -------------------------------------------------------------------------------- /Markers/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/c.png -------------------------------------------------------------------------------- /Markers/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/d.png -------------------------------------------------------------------------------- /UAV- localization/Ros simulator for ar drone/rossim.txt: -------------------------------------------------------------------------------- 1 | https://github.com/dougvk/tum_simulator 2 | -------------------------------------------------------------------------------- /Docs/fig637_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/fig637_01.jpg -------------------------------------------------------------------------------- /Markers/nothing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/nothing.png -------------------------------------------------------------------------------- /Docs/PID Control.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/PID Control.pptx -------------------------------------------------------------------------------- /Docs/Numpyrefresher.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/Numpyrefresher.pdf -------------------------------------------------------------------------------- /Docs/PID-Controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/PID-Controller.png -------------------------------------------------------------------------------- /Docs/drone-academy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/drone-academy.jpg -------------------------------------------------------------------------------- /Docs/Visual Odometry.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/Visual Odometry.pptx -------------------------------------------------------------------------------- /Docs/Computer Vision-local.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/Computer Vision-local.pptx -------------------------------------------------------------------------------- /Docs/kalmanTrackingDemo_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/kalmanTrackingDemo_02.png -------------------------------------------------------------------------------- /VREP QuadCopter Class/remoteApi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/VREP QuadCopter Class/remoteApi.so -------------------------------------------------------------------------------- /UAV- localization/documentation/cv.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/cv.jpg -------------------------------------------------------------------------------- /UAV- localization/documentation/pid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/pid.png -------------------------------------------------------------------------------- /Docs/Localization Using a Quad-Copter.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Docs/Localization Using a Quad-Copter.pptx -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile1.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile10.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile11.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile12.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile13.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile14.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile15.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile16.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile17.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile18.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile19.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile2.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile20.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile3.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile4.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile5.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile6.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile7.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile8.png -------------------------------------------------------------------------------- /Markers/Aruco markers - print!/outfile9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/Aruco markers - print!/outfile9.png -------------------------------------------------------------------------------- /Markers/marker detector program/RR-6303.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/marker detector program/RR-6303.pdf -------------------------------------------------------------------------------- /Markers/marker detector program/testImg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/marker detector program/testImg.jpg -------------------------------------------------------------------------------- /Markers/marker detector program/testImg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/marker detector program/testImg2.jpg -------------------------------------------------------------------------------- /Markers/marker detector program/testImg3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/marker detector program/testImg3.jpg -------------------------------------------------------------------------------- /VREP QuadCopter Class/quadcopter_markers.ttt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/VREP QuadCopter Class/quadcopter_markers.ttt -------------------------------------------------------------------------------- /UAV- localization/documentation/fig637_01.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/fig637_01.jpg -------------------------------------------------------------------------------- /Markers/marker detector program/outputFile3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/marker detector program/outputFile3.png -------------------------------------------------------------------------------- /UAV- localization/documentation/PID Control.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/PID Control.pptx -------------------------------------------------------------------------------- /UAV- localization/documentation/drone-academy.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/drone-academy.jpg -------------------------------------------------------------------------------- /UAV- localization/documentation/Numpyrefresher.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/Numpyrefresher.pdf -------------------------------------------------------------------------------- /UAV- localization/documentation/PID-Controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/PID-Controller.png -------------------------------------------------------------------------------- /UAV- localization/documentation/Visual Odometry.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/Visual Odometry.pptx -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_17.82707.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_17.82707.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_9.908949.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_9.908949.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_9.956183.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_9.956183.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_8.435547.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_8.435547.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.045767.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.045767.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.284237.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.284237.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.328037.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.328037.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.336504.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.336504.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.517526.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.517526.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.595289.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.595289.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.746721.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.746721.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.750689.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.750689.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_67.899309.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_67.899309.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_68.024345.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_68.024345.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_68.543302.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_68.543302.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_68.685578.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_68.685578.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_68.763372.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_68.763372.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_68.772713.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_68.772713.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_68.827019.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_68.827019.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_69.320953.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_69.320953.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_69.389619.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_69.389619.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_70.271616.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_70.271616.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_70.744441.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_70.744441.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/contour/error_73.696263.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/contour/error_73.696263.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_64.262282.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_64.262282.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_64.359956.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_64.359956.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_65.231783.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_65.231783.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_65.596707.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_65.596707.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_65.671344.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_65.671344.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_65.746533.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_65.746533.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_65.823599.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_65.823599.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_66.097379.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_66.097379.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_66.430329.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_66.430329.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 1/template/error_68.554352.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 1/template/error_68.554352.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_10.113866.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_10.113866.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_16.497101.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_16.497101.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_17.301278.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_17.301278.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_17.347898.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_17.347898.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_17.495717.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_17.495717.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_17.749991.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_17.749991.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/contour/error_18.286592.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/contour/error_18.286592.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_13.106892.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_13.106892.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_13.132654.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_13.132654.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_13.180408.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_13.180408.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_13.26363.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_13.26363.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_13.315284.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_13.315284.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_13.442899.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_13.442899.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_13.592966.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_13.592966.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_14.303803.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_14.303803.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_14.610141.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_14.610141.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 2/template/error_14.638425.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 2/template/error_14.638425.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_10.070504.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_10.070504.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_10.494471.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_10.494471.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_15.904612.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_15.904612.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_15.910477.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_15.910477.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_16.229379.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_16.229379.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_16.487604.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_16.487604.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_17.563817.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_17.563817.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_18.151346.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_18.151346.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/contour/error_18.654254.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/contour/error_18.654254.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_12.787023.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_12.787023.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_12.933079.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_12.933079.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_13.070773.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_13.070773.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_13.641489.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_13.641489.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_13.928491.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_13.928491.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_14.104753.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_14.104753.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_14.393209.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_14.393209.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_14.456265.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_14.456265.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_15.265675.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_15.265675.npy -------------------------------------------------------------------------------- /Extended_testing/Trajectory 3/template/error_17.522199.npy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Extended_testing/Trajectory 3/template/error_17.522199.npy -------------------------------------------------------------------------------- /Markers/marker detector program/homography_estimation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Markers/marker detector program/homography_estimation.pdf -------------------------------------------------------------------------------- /UAV- localization/documentation/Computer Vision-local.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/Computer Vision-local.pptx -------------------------------------------------------------------------------- /UAV- localization/documentation/kalmanTrackingDemo_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/kalmanTrackingDemo_02.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile1.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile2.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile3.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile4.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile5.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile6.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile7.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile8.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile9.png -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/RR-6303.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/marker detector program/RR-6303.pdf -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/testImg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/marker detector program/testImg.jpg -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile10.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile11.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile12.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile13.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile14.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile15.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile16.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile17.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile18.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile19.png -------------------------------------------------------------------------------- /UAV- localization/Markers/Aruco markers - print!/outfile20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/Aruco markers - print!/outfile20.png -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/testImg2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/marker detector program/testImg2.jpg -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/testImg3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/marker detector program/testImg3.jpg -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/outputFile3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/marker detector program/outputFile3.png -------------------------------------------------------------------------------- /UAV- localization/documentation/Localization Using a Quad-Copter.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/documentation/Localization Using a Quad-Copter.pptx -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/homography_estimation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/UAV- localization/Markers/marker detector program/homography_estimation.pdf -------------------------------------------------------------------------------- /Report/Preprocessing methods for Quadcopter Localization using Colored Markers - IEEE SocPaR 2016 - Springer.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dheesaur/Marker-Based-Localisation-UAVs/HEAD/Report/Preprocessing methods for Quadcopter Localization using Colored Markers - IEEE SocPaR 2016 - Springer.pdf -------------------------------------------------------------------------------- /VREP QuadCopter Class/test_quadcopter.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import time 3 | from Quadcopter import Quadcopter 4 | 5 | 6 | q = Quadcopter() 7 | 8 | 9 | 10 | for i in range(1000): 11 | 12 | # prints the position, the same can be confirmed from inside VREP 13 | print q.get_position() 14 | 15 | time.sleep(0.1) 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Marker Based Localisation in Uavs 2 | 3 | A. N. J Raj, A. Chawla, G. Sridhar and Dheeraj Akshay. ‘A Comparative Study of Preprocessing Techniques for Marker Based Localization in UAVs’. Published in Proceedings of the IEEE 8th International Conference on Soft Computing and Pattern Recognition (SoCPaR) - [Springer. Dec 2016](https://link.springer.com/chapter/10.1007/978-3-319-60618-7_41) 4 | 5 | [Final Report](https://drive.google.com/open?id=1CRPPO9jmNzezymJ9eCBY3RN1Sk9j3U4e) 6 | -------------------------------------------------------------------------------- /Kalman KNN/knn.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import cv2 3 | 4 | 5 | def knn(test, train_images): 6 | 'compare test against train_images' 7 | 8 | test_ravel = np.ravel(test) 9 | train_ravel = [np.ravel(img) for img in train_images] 10 | 11 | min_metric = np.norm(test_ravel-train_ravel[0]) 12 | min_idx = 0 13 | 14 | for i,img in enumerate(train_ravel): 15 | 16 | metric = np.norm(test_ravel-img) 17 | if metric0: 19 | peri = cv2.arcLength(cnts[0], True) 20 | approx = cv2.approxPolyDP(cnts[0], 0.02 * peri, True) 21 | 22 | if len(approx) == 4: 23 | 24 | # candidate for marker 25 | x , y , w, h = cv2.boundingRect(cnts[0]) 26 | roi = frame[y: y + h, x: x + w] 27 | resized_roi = cv2.resize(roi, (114, 114)) 28 | return 1, resized_roi 29 | 30 | else: 31 | 32 | return 0,0 33 | else: 34 | 35 | return 0,0 36 | 37 | 38 | # main 39 | camera_img = cv2.imread('./Test_Images/a.png') 40 | rc, marker_detected = contour_match(camera_img) 41 | print marker_detected 42 | cv2.imshow('op', marker_detected) 43 | cv2.waitKey(0) 44 | 45 | -------------------------------------------------------------------------------- /UAV- localization/PID Control/PIDinitial.py: -------------------------------------------------------------------------------- 1 | import numpy 2 | import scipy 3 | import rospy 4 | from std_msgs.msg import Empty 5 | from geometry_msgs.msg import Twist 6 | import time 7 | 8 | def PID(object): 9 | def __init__(self, P = 0.0, D = 1.0, I = 0.0, Proportional=0.0, Derivative = 0.0, Integrate=0.0, Imax=500, Imin=-500): 10 | self._Kp=P 11 | self._Ki=I 12 | self._Kd=D 13 | self._Proportional = Proportional 14 | self._Derivative = Derivative 15 | self._Integrate = Integrate 16 | self.Imax=Imax 17 | self.Imin=Imin 18 | 19 | self._setPoint = 0.0 20 | self.prevError = 0.0 21 | self.prevError = 0.0 22 | self.currTime = 0.0 23 | self.prevTime = 0.0 24 | 25 | 26 | @property 27 | def setPoint(self): 28 | return self._setpoint 29 | 30 | @SetPoint.setter 31 | def setPoint(self, set_point): 32 | self._setPoint = set_point 33 | 34 | def Compute(self, curr_value): 35 | self.curTime = time.time() 36 | dt = self.curTime - self.prevTime 37 | error = self._setpoint - curr_value 38 | de = error - self.prevError 39 | self._Proportional = self._Kp*error 40 | self_Derivative=self._Kd*(de/dt) 41 | 42 | if self.Integrator > self.Integrator_max: 43 | self.Integrator = self.Integrator_max 44 | elif self.Integrator < self.Integrator_min: 45 | self.Integrator = self.Integrator_min 46 | 47 | self._Integrate = prevError + self._Ki*error 48 | PID = self._Proportional+self._Derivative+self._Integrate 49 | return (PID) 50 | PIDdif = PID/dt 51 | return (PIDdif) 52 | prevError = error 53 | self.prevTime = self.curTime; 54 | -------------------------------------------------------------------------------- /UAV- localization/xcontrol.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ipython 2 | 3 | #to control the drone using xbox controller 4 | 5 | import rospy 6 | import time 7 | from std_msgs.msg import Empty 8 | from geometry_msgs.msg import Twist 9 | from sensor_msgs.msg import Joy 10 | 11 | #declare a global publisher 12 | #declare the publishers and subscribers 13 | pub_takeoff = rospy.Publisher('/ardrone/takeoff',Empty,queue_size=1) 14 | pub_land = rospy.Publisher('/ardrone/land',Empty,queue_size=1) 15 | pub_cmdvel = rospy.Publisher('/cmd_vel',Twist,queue_size = 1) 16 | 17 | state = 0 #0-landed , 1-flying 18 | def callback(data): 19 | 20 | global state 21 | if data.buttons[0] == 1 or data.buttons[1]==1: 22 | 23 | if data.buttons[0] == 1: 24 | msg = Empty() 25 | pub_takeoff.publish(msg) 26 | state = 1 27 | rospy.loginfo('taking off') 28 | elif data.buttons[1]== 1: 29 | msg = Empty() 30 | pub_land.publish(msg) 31 | state = 0 32 | rospy.loginfo('landing') 33 | 34 | else: 35 | 36 | msg = Twist() 37 | msg.linear.y = data.axes[0] if abs(data.axes[0])>0.1 else 0 38 | msg.linear.x = data.axes[1] if abs(data.axes[1])>0.1 else 0 39 | msg.angular.z = data.axes[3] if abs(data.axes[3])>0.1 else 0 40 | 41 | if int(data.axes[2]) == -1: 42 | msg.linear.z = 0.2 43 | elif int(data.axes[5])==-1: 44 | msg.linear.z = -0.2 45 | 46 | pub_cmdvel.publish(msg) 47 | 48 | 49 | 50 | 51 | def main(): 52 | 53 | rospy.init_node('xcontrol',anonymous=True) 54 | rospy.Subscriber('joy',Joy,callback) 55 | rospy.spin() 56 | 57 | 58 | 59 | if __name__ == '__main__': 60 | main() -------------------------------------------------------------------------------- /UAV- localization/teleop_drone.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import rospy 4 | from std_msgs.msg import Empty 5 | from geometry_msgs.msg import Twist 6 | from getch import getch, pause 7 | import time 8 | 9 | def main(): 10 | 'MAIN FUNCTION' 11 | 12 | #declare the publishers and subscribers 13 | pub_takeoff = rospy.Publisher('/ardrone/takeoff',Empty,queue_size=1) 14 | pub_land = rospy.Publisher('/ardrone/land',Empty,queue_size=1) 15 | pub_cmdvel = rospy.Publisher('/cmd_vel',Twist,queue_size = 1) 16 | 17 | 18 | #initiate the node 19 | rospy.init_node('teleop_drone',anonymous = True) 20 | 21 | while not rospy.is_shutdown(): 22 | 23 | 24 | ip = getch() 25 | if ip == 't' or ip == 'T': 26 | msg = Empty() 27 | pub_takeoff.publish(msg) 28 | elif ip == 'l' or ip == 'L': 29 | msg = Empty() 30 | pub_land.publish(msg) 31 | elif ip == 'w': 32 | msg = Twist() 33 | msg.linear.x = 0.8 34 | pub_cmdvel.publish(msg) 35 | elif ip == 's': 36 | msg = Twist() 37 | msg.linear.x = -0.8 38 | pub_cmdvel.publish(msg) 39 | elif ip == 'a': 40 | msg = Twist() 41 | msg.linear.y = 0.8 42 | pub_cmdvel.publish(msg) 43 | elif ip == 'd': 44 | msg = Twist() 45 | msg.linear.y = -0.8 46 | pub_cmdvel.publish(msg) 47 | elif ip == 'e': 48 | msg = Twist() 49 | msg.angular.z = -0.8 50 | pub_cmdvel.publish(msg) 51 | elif ip == 'q': 52 | msg = Twist() 53 | msg.angular.z = 0.8 54 | pub_cmdvel.publish(msg) 55 | 56 | 57 | else: 58 | print 'Not a valid Input!' 59 | msg = Twist() 60 | msg.linear.x = 0 61 | msg.linear.y = 0 62 | msg.linear.z = 0 63 | msg.angular.x = 0 64 | msg.angular.y = 0 65 | msg.angular.z = 0 66 | pub_cmdvel.publish(msg) 67 | #time.sleep(1) 68 | 69 | 70 | print 'Shutdown...' 71 | 72 | 73 | 74 | 75 | if __name__ == '__main__': 76 | main() -------------------------------------------------------------------------------- /VREP QuadCopter Class/Quadcopter.py: -------------------------------------------------------------------------------- 1 | import vrep 2 | import numpy as np 3 | import cv2 4 | import time 5 | 6 | class Quadcopter(): 7 | """Get data from and to V-REP""" 8 | def __init__(self): 9 | 10 | vrep.simxFinish(-1) 11 | self.clientID = vrep.simxStart('127.0.0.1', 19997, True, True, 5000, 5) 12 | 13 | # start simulation 14 | rc = vrep.simxStartSimulation(self.clientID, vrep.simx_opmode_oneshot_wait) 15 | 16 | # object handles 17 | res, self.quad_obj = vrep.simxGetObjectHandle(self.clientID, 'Quadricopter', vrep.simx_opmode_oneshot_wait) 18 | res, self.camera = vrep.simxGetObjectHandle(self.clientID, 'Vision_sensor', vrep.simx_opmode_oneshot_wait) 19 | 20 | # Initialise data streaming from V-REP 21 | err, resolution, image = vrep.simxGetVisionSensorImage(self.clientID, self.camera, 0, vrep.simx_opmode_streaming) 22 | _,pos = vrep.simxGetObjectPosition(self.clientID, self.quad_obj, -1, vrep.simx_opmode_streaming) 23 | time.sleep(2) 24 | 25 | # Variables 26 | _,self.last_pos = vrep.simxGetObjectPosition(self.clientID, self.quad_obj, -1, vrep.simx_opmode_buffer) 27 | 28 | def get_position(self): 29 | 'Get the quadcopters position' 30 | _, pos = vrep.simxGetObjectPosition(self.clientID, self.quad_obj, -1, vrep.simx_opmode_buffer) 31 | return pos 32 | 33 | def get_odometry(self): 34 | 'Get the del_x and del_y between current and previous position' 35 | cur_pos = self.get_position() 36 | odometry = [cur_pos[0]-self.last_pos[0], cur_pos[1]-self.last_pos[1]] 37 | #update last position 38 | self.last_pos = cur_pos 39 | return odometry 40 | 41 | def get_camera_image(self): 42 | 'Get the image from the camera' 43 | 44 | err, resolution, image = vrep.simxGetVisionSensorImage(self.clientID, self.camera, 0, vrep.simx_opmode_buffer) 45 | img = np.array(image,dtype=np.uint8) 46 | img.resize([resolution[1],resolution[0],3]) 47 | img = np.fliplr(img) 48 | temp = np.copy(img[:,:,0]) 49 | img[:,:,0] = np.copy(img[:,:,2]) 50 | img[:,:,2] = temp 51 | return img 52 | 53 | -------------------------------------------------------------------------------- /Markers/marker detector program/findH.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | 8 | def findH(ipPoints,opPoints): 9 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 10 | 11 | # computing the A matrix to calculate Ah = 0 12 | A = [] 13 | for x1,x2 in zip(ipPoints,opPoints): 14 | 15 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 16 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 17 | A.append(a_x) 18 | A.append(a_y) 19 | 20 | A = np.array(A) 21 | 22 | # finding SVD of A 23 | u,s,v = np.linalg.svd(A) 24 | #taking the column corresponding to the smallest singular value 25 | h = v[8] 26 | #rearranging in 3x3 format 27 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 28 | return H 29 | 30 | 31 | 32 | def main(): 33 | 34 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 35 | ipPoints = [[203, 178], [390, 184], [210, 298], [423, 306]] 36 | opPoints = [ [0,0],[100,0],[0,100],[100,100] ] 37 | 38 | for pt in ipPoints: 39 | cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 40 | 41 | #cv2.imshow('input', imgInput) 42 | #cv2.waitKey(0) 43 | H = findH(ipPoints, opPoints) 44 | print imgInput.shape 45 | print 'printing tuple of values' 46 | imgOutput = np.zeros((100,100)) 47 | it = np.nditer(imgInput,flags = ['multi_index']) 48 | while not it.finished: 49 | pt = it.multi_index 50 | pt1 = np.array([pt[1],pt[0],1]) 51 | pt2_homo = np.dot(H,np.transpose(pt1)) 52 | pt2 = pt2_homo/pt2_homo[2] 53 | pt2 = np.asarray(pt2[0:2],dtype='int32') 54 | print 'Input: {}\t Output: {}'.format(pt1,pt2) 55 | if pt2[0]>0 and pt2[0]<100 and pt2[1]>0 and pt2[1]<100: 56 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 57 | 58 | it.iternext() 59 | cv2.imwrite('outputFile.png', imgOutput) 60 | 61 | # for pt in ipPoints: 62 | # pt1 = np.array([ pt[0],pt[1],1 ]) 63 | # pt2_homo = np.dot(H,np.transpose(pt1)) 64 | # pt2 = pt2_homo/pt2_homo[2] 65 | # pt2 = np.asarray(pt2[0:2],dtype='uint8') 66 | # print 'Input: {}\t Output: {}'.format(pt,pt2) 67 | 68 | if __name__ == '__main__': 69 | main() -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/findH.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | 8 | def findH(ipPoints,opPoints): 9 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 10 | 11 | # computing the A matrix to calculate Ah = 0 12 | A = [] 13 | for x1,x2 in zip(ipPoints,opPoints): 14 | 15 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 16 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 17 | A.append(a_x) 18 | A.append(a_y) 19 | 20 | A = np.array(A) 21 | 22 | # finding SVD of A 23 | u,s,v = np.linalg.svd(A) 24 | #taking the column corresponding to the smallest singular value 25 | h = v[8] 26 | #rearranging in 3x3 format 27 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 28 | return H 29 | 30 | 31 | 32 | def main(): 33 | 34 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 35 | ipPoints = [[203, 178], [390, 184], [210, 298], [423, 306]] 36 | opPoints = [ [0,0],[100,0],[0,100],[100,100] ] 37 | 38 | for pt in ipPoints: 39 | cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 40 | 41 | #cv2.imshow('input', imgInput) 42 | #cv2.waitKey(0) 43 | H = findH(ipPoints, opPoints) 44 | print imgInput.shape 45 | print 'printing tuple of values' 46 | imgOutput = np.zeros((100,100)) 47 | it = np.nditer(imgInput,flags = ['multi_index']) 48 | while not it.finished: 49 | pt = it.multi_index 50 | pt1 = np.array([pt[1],pt[0],1]) 51 | pt2_homo = np.dot(H,np.transpose(pt1)) 52 | pt2 = pt2_homo/pt2_homo[2] 53 | pt2 = np.asarray(pt2[0:2],dtype='int32') 54 | print 'Input: {}\t Output: {}'.format(pt1,pt2) 55 | if pt2[0]>0 and pt2[0]<100 and pt2[1]>0 and pt2[1]<100: 56 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 57 | 58 | it.iternext() 59 | cv2.imwrite('outputFile.png', imgOutput) 60 | 61 | # for pt in ipPoints: 62 | # pt1 = np.array([ pt[0],pt[1],1 ]) 63 | # pt2_homo = np.dot(H,np.transpose(pt1)) 64 | # pt2 = pt2_homo/pt2_homo[2] 65 | # pt2 = np.asarray(pt2[0:2],dtype='uint8') 66 | # print 'Input: {}\t Output: {}'.format(pt,pt2) 67 | 68 | if __name__ == '__main__': 69 | main() -------------------------------------------------------------------------------- /Markers/marker detector program/findH4.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | import time 8 | 9 | def findH(ipPoints,opPoints): 10 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 11 | 12 | # computing the A matrix to calculate Ah = 0 13 | A = [] 14 | for x1,x2 in zip(ipPoints,opPoints): 15 | 16 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 17 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 18 | A.append(a_x) 19 | A.append(a_y) 20 | 21 | A = np.array(A) 22 | 23 | # finding SVD of A 24 | u,s,v = np.linalg.svd(A) 25 | #taking the column corresponding to the smallest singular value 26 | h = v[8] 27 | #rearranging in 3x3 format 28 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 29 | return H 30 | 31 | 32 | 33 | def main(): 34 | 35 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 36 | ipPoints = [[203/2, 178/2], [390/2, 184/2], [210/2, 298/2], [423/2, 306/2]] 37 | opPoints = [ [0,0],[40,0],[0,40],[40,40] ] 38 | 39 | #for pt in ipPoints: 40 | # cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 41 | 42 | #cv2.imshow('input', imgInput) 43 | #cv2.waitKey(0) 44 | H = findH(ipPoints, opPoints) 45 | print H 46 | #print imgInput.shape 47 | #print 'printing tuple of values' 48 | imgOutput = np.zeros((40,40)) 49 | xmax = max([pt[0] for pt in ipPoints]) 50 | xmin = min([pt[0] for pt in ipPoints]) 51 | ymax = max([pt[1] for pt in ipPoints]) 52 | ymin = min([pt[1] for pt in ipPoints]) 53 | 54 | it = np.nditer(imgInput,flags = ['multi_index']) 55 | while not it.finished: 56 | pt = it.multi_index 57 | if pt[0]>=ymin and pt[0]<=ymax and pt[1]>=xmin and pt[1]<=xmax: 58 | pt1 = np.array([pt[1],pt[0],1]) 59 | pt2_homo = np.dot(H,np.transpose(pt1)) 60 | pt2 = pt2_homo/pt2_homo[2] 61 | pt2 = np.asarray(pt2[0:2],dtype='int32') 62 | if pt2[0]>0 and pt2[0]<40 and pt2[1]>0 and pt2[1]<40: 63 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 64 | 65 | 66 | it.iternext() 67 | 68 | cv2.imshow('output', imgOutput) 69 | cv2.waitKey(0) 70 | #cv2.imwrite('outputFile3.png', imgOutput) 71 | 72 | if __name__ == '__main__': 73 | main() -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/findH4.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | import time 8 | 9 | def findH(ipPoints,opPoints): 10 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 11 | 12 | # computing the A matrix to calculate Ah = 0 13 | A = [] 14 | for x1,x2 in zip(ipPoints,opPoints): 15 | 16 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 17 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 18 | A.append(a_x) 19 | A.append(a_y) 20 | 21 | A = np.array(A) 22 | 23 | # finding SVD of A 24 | u,s,v = np.linalg.svd(A) 25 | #taking the column corresponding to the smallest singular value 26 | h = v[8] 27 | #rearranging in 3x3 format 28 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 29 | return H 30 | 31 | 32 | 33 | def main(): 34 | 35 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 36 | ipPoints = [[203/2, 178/2], [390/2, 184/2], [210/2, 298/2], [423/2, 306/2]] 37 | opPoints = [ [0,0],[40,0],[0,40],[40,40] ] 38 | 39 | #for pt in ipPoints: 40 | # cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 41 | 42 | #cv2.imshow('input', imgInput) 43 | #cv2.waitKey(0) 44 | H = findH(ipPoints, opPoints) 45 | print H 46 | #print imgInput.shape 47 | #print 'printing tuple of values' 48 | imgOutput = np.zeros((40,40)) 49 | xmax = max([pt[0] for pt in ipPoints]) 50 | xmin = min([pt[0] for pt in ipPoints]) 51 | ymax = max([pt[1] for pt in ipPoints]) 52 | ymin = min([pt[1] for pt in ipPoints]) 53 | 54 | it = np.nditer(imgInput,flags = ['multi_index']) 55 | while not it.finished: 56 | pt = it.multi_index 57 | if pt[0]>=ymin and pt[0]<=ymax and pt[1]>=xmin and pt[1]<=xmax: 58 | pt1 = np.array([pt[1],pt[0],1]) 59 | pt2_homo = np.dot(H,np.transpose(pt1)) 60 | pt2 = pt2_homo/pt2_homo[2] 61 | pt2 = np.asarray(pt2[0:2],dtype='int32') 62 | if pt2[0]>0 and pt2[0]<40 and pt2[1]>0 and pt2[1]<40: 63 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 64 | 65 | 66 | it.iternext() 67 | 68 | cv2.imshow('output', imgOutput) 69 | cv2.waitKey(0) 70 | #cv2.imwrite('outputFile3.png', imgOutput) 71 | 72 | if __name__ == '__main__': 73 | main() -------------------------------------------------------------------------------- /Markers/marker detector program/findH2.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | import time 8 | 9 | def findH(ipPoints,opPoints): 10 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 11 | 12 | # computing the A matrix to calculate Ah = 0 13 | A = [] 14 | for x1,x2 in zip(ipPoints,opPoints): 15 | 16 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 17 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 18 | A.append(a_x) 19 | A.append(a_y) 20 | 21 | A = np.array(A) 22 | 23 | # finding SVD of A 24 | u,s,v = np.linalg.svd(A) 25 | #taking the column corresponding to the smallest singular value 26 | h = v[8] 27 | #rearranging in 3x3 format 28 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 29 | return H 30 | 31 | 32 | 33 | def main(): 34 | 35 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 36 | ipPoints = [[203, 178], [390, 184], [210, 298], [423, 306]] 37 | opPoints = [ [0,0],[100,0],[0,100],[100,100] ] 38 | 39 | for pt in ipPoints: 40 | cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 41 | 42 | #cv2.imshow('input', imgInput) 43 | #cv2.waitKey(0) 44 | H = findH(ipPoints, opPoints) 45 | print imgInput.shape 46 | print 'printing tuple of values' 47 | imgOutput = np.zeros((100,100)) 48 | xmax = max([pt[0] for pt in ipPoints]) 49 | xmin = min([pt[0] for pt in ipPoints]) 50 | ymax = max([pt[1] for pt in ipPoints]) 51 | ymin = min([pt[1] for pt in ipPoints]) 52 | 53 | it = np.nditer(imgInput,flags = ['multi_index']) 54 | while not it.finished: 55 | pt = it.multi_index 56 | if pt[0]>=ymin and pt[0]<=ymax and pt[1]>=xmin and pt[1]<=xmax: 57 | pt1 = np.array([pt[1],pt[0],1]) 58 | pt2_homo = np.dot(H,np.transpose(pt1)) 59 | pt2 = pt2_homo/pt2_homo[2] 60 | pt2 = np.asarray(pt2[0:2],dtype='int32') 61 | #print 'Input: {}\t Output: {}'.format(pt1,pt2) 62 | if pt2[0]>0 and pt2[0]<100 and pt2[1]>0 and pt2[1]<100: 63 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 64 | else: 65 | pass 66 | 67 | it.iternext() 68 | 69 | #cv2.imwrite('outputFile3.png', imgOutput) 70 | 71 | # for pt in ipPoints: 72 | # pt1 = np.array([ pt[0],pt[1],1 ]) 73 | # pt2_homo = np.dot(H,np.transpose(pt1)) 74 | # pt2 = pt2_homo/pt2_homo[2] 75 | # pt2 = np.asarray(pt2[0:2],dtype='uint8') 76 | # print 'Input: {}\t Output: {}'.format(pt,pt2) 77 | 78 | if __name__ == '__main__': 79 | main() -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/findH2.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | import time 8 | 9 | def findH(ipPoints,opPoints): 10 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 11 | 12 | # computing the A matrix to calculate Ah = 0 13 | A = [] 14 | for x1,x2 in zip(ipPoints,opPoints): 15 | 16 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 17 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 18 | A.append(a_x) 19 | A.append(a_y) 20 | 21 | A = np.array(A) 22 | 23 | # finding SVD of A 24 | u,s,v = np.linalg.svd(A) 25 | #taking the column corresponding to the smallest singular value 26 | h = v[8] 27 | #rearranging in 3x3 format 28 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 29 | return H 30 | 31 | 32 | 33 | def main(): 34 | 35 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 36 | ipPoints = [[203, 178], [390, 184], [210, 298], [423, 306]] 37 | opPoints = [ [0,0],[100,0],[0,100],[100,100] ] 38 | 39 | for pt in ipPoints: 40 | cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 41 | 42 | #cv2.imshow('input', imgInput) 43 | #cv2.waitKey(0) 44 | H = findH(ipPoints, opPoints) 45 | print imgInput.shape 46 | print 'printing tuple of values' 47 | imgOutput = np.zeros((100,100)) 48 | xmax = max([pt[0] for pt in ipPoints]) 49 | xmin = min([pt[0] for pt in ipPoints]) 50 | ymax = max([pt[1] for pt in ipPoints]) 51 | ymin = min([pt[1] for pt in ipPoints]) 52 | 53 | it = np.nditer(imgInput,flags = ['multi_index']) 54 | while not it.finished: 55 | pt = it.multi_index 56 | if pt[0]>=ymin and pt[0]<=ymax and pt[1]>=xmin and pt[1]<=xmax: 57 | pt1 = np.array([pt[1],pt[0],1]) 58 | pt2_homo = np.dot(H,np.transpose(pt1)) 59 | pt2 = pt2_homo/pt2_homo[2] 60 | pt2 = np.asarray(pt2[0:2],dtype='int32') 61 | #print 'Input: {}\t Output: {}'.format(pt1,pt2) 62 | if pt2[0]>0 and pt2[0]<100 and pt2[1]>0 and pt2[1]<100: 63 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 64 | else: 65 | pass 66 | 67 | it.iternext() 68 | 69 | #cv2.imwrite('outputFile3.png', imgOutput) 70 | 71 | # for pt in ipPoints: 72 | # pt1 = np.array([ pt[0],pt[1],1 ]) 73 | # pt2_homo = np.dot(H,np.transpose(pt1)) 74 | # pt2 = pt2_homo/pt2_homo[2] 75 | # pt2 = np.asarray(pt2[0:2],dtype='uint8') 76 | # print 'Input: {}\t Output: {}'.format(pt,pt2) 77 | 78 | if __name__ == '__main__': 79 | main() -------------------------------------------------------------------------------- /Markers/marker detector program/findH3.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | import time 8 | 9 | def findH(ipPoints,opPoints): 10 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 11 | 12 | # computing the A matrix to calculate Ah = 0 13 | A = [] 14 | for x1,x2 in zip(ipPoints,opPoints): 15 | 16 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 17 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 18 | A.append(a_x) 19 | A.append(a_y) 20 | 21 | A = np.array(A) 22 | 23 | # finding SVD of A 24 | u,s,v = np.linalg.svd(A) 25 | #taking the column corresponding to the smallest singular value 26 | h = v[8] 27 | #rearranging in 3x3 format 28 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 29 | return H 30 | 31 | def cameraPoseFromHomography(H): 32 | 'Estimate the camera pose from the homography' 33 | H1 = H[:,0] 34 | H2 = H[:,1] 35 | H3 = np.cross(H1, H2) 36 | 37 | norm1 = np.linalg.norm(H1) 38 | norm2 = np.linalg.norm(H2) 39 | tnorm = (norm1 + norm2)/2.0 40 | 41 | T = H[:,2]/tnorm 42 | return np.mat([H1, H2, H3, T]) 43 | 44 | def main(): 45 | 46 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 47 | ipPoints = [[203, 178], [390, 184], [210, 298], [423, 306]] 48 | opPoints = [ [0,0],[100,0],[0,100],[100,100] ] 49 | 50 | #for pt in ipPoints: 51 | # cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 52 | 53 | #cv2.imshow('input', imgInput) 54 | #cv2.waitKey(0) 55 | H = findH(ipPoints, opPoints) 56 | print cameraPoseFromHomography(H) 57 | 58 | #print imgInput.shape 59 | #print 'printing tuple of values' 60 | imgOutput = np.zeros((100,100)) 61 | xmax = max([pt[0] for pt in ipPoints]) 62 | xmin = min([pt[0] for pt in ipPoints]) 63 | ymax = max([pt[1] for pt in ipPoints]) 64 | ymin = min([pt[1] for pt in ipPoints]) 65 | 66 | it = np.nditer(imgInput,flags = ['multi_index']) 67 | while not it.finished: 68 | pt = it.multi_index 69 | if pt[0]>=ymin and pt[0]<=ymax and pt[1]>=xmin and pt[1]<=xmax: 70 | pt1 = np.array([pt[1],pt[0],1]) 71 | pt2_homo = np.dot(H,np.transpose(pt1)) 72 | pt2 = pt2_homo/pt2_homo[2] 73 | pt2 = np.asarray(pt2[0:2],dtype='int32') 74 | if pt2[0]>0 and pt2[0]<100 and pt2[1]>0 and pt2[1]<100: 75 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 76 | 77 | 78 | it.iternext() 79 | 80 | cv2.imwrite('outputFile3.png', imgOutput) 81 | 82 | if __name__ == '__main__': 83 | main() -------------------------------------------------------------------------------- /Kalman KNN/KalmanFilter.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ipython 2 | 3 | print 'Importing Libraries' 4 | 5 | import matplotlib.pyplot as plt 6 | import numpy as np 7 | import rospy 8 | from std_msgs.msg import Empty 9 | from geometry_msgs.msg import Twist 10 | from ardrone_autonomy.msg import Navdata 11 | from math import sin,cos,degrees,radians 12 | 13 | print 'Libraries imported' 14 | plt.ion() 15 | 16 | class KalmanFilter(object): 17 | """Defining a Kalman filter class""" 18 | def __init__(self): 19 | self.x = np.asarray([0,0,0],dtype='float32') #x,y,phi 20 | self.P = np.diag([10,10,10]) 21 | self.Q = np.diag([0.005,0.005,0.005]) 22 | self.prev_rotZ = 0 23 | self.prev_time = 0 24 | self.first_run = 1 25 | 26 | self.f = open('output_data.txt','w') 27 | 28 | 29 | def prediction_update(self,navdata): 30 | 31 | if self.first_run==1 or navdata.state in [1,2,6,8] : #the node just started 32 | self.prev_time = navdata.tm/1000000.0 33 | self.prev_rotZ = navdata.rotZ 34 | self.first_run = 0 35 | 36 | else: 37 | 38 | #extracting values 39 | rotZ = 0 #converting from 0 - 360 (anticlockwise) 40 | #if navdata.rotZ<0: 41 | # rotZ = navdata.rotZ + 360 42 | #else: 43 | # rotZ = navdata.rotZ 44 | rotZ = navdata.rotZ 45 | vx = navdata.vx/1000.0 46 | vy = navdata.vy/1000.0 47 | 48 | 49 | dt = (navdata.tm/1000000.0) - self.prev_time 50 | vphi = (rotZ - self.prev_rotZ)/dt 51 | self.prev_rotZ = rotZ 52 | self.prev_time = navdata.tm/1000000.0 53 | 54 | #kalman code 55 | 56 | #1. Update the state x 57 | new_x = np.asarray([self.x[0] + dt*( cos(radians(self.x[2]))*vx - sin(radians(self.x[2]))*vy ) , 58 | self.x[1] + dt*( sin(radians(self.x[2]))*vx + cos(radians(self.x[2]))*vy ) , 59 | self.x[2] + dt*vphi]) 60 | 61 | 62 | self.x = new_x 63 | self.f.write(str(self.x[0])+" "+str(self.x[1])+'\n') 64 | 65 | #2. Update the covariance matrix 66 | 67 | F = np.array([ [1 , 0, dt*(-sin(radians(self.x[2]))*vx - cos(radians(self.x[2]))*vy )] , 68 | [0 , 1, dt*(cos(radians(self.x[2]))*vx - sin(radians(self.x[2]))*vy )] , 69 | [0 , 0, 1] 70 | 71 | ]) 72 | new_P = np.dot(F,np.dot(self.P,F.T)) + self.Q 73 | self.P = new_P 74 | def close_file(self): 75 | self.f.close() 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | def main(): 86 | 87 | kf = KalmanFilter() 88 | rospy.init_node('filter',anonymous=True) 89 | rospy.Subscriber('/ardrone/navdata',Navdata,kf.prediction_update) 90 | rospy.spin() 91 | if rospy.is_shutdown(): 92 | kf.close_file() 93 | 94 | 95 | if __name__ == '__main__': 96 | main() 97 | -------------------------------------------------------------------------------- /UAV- localization/Markers/marker detector program/findH3.py: -------------------------------------------------------------------------------- 1 | # finding the homography between 2 sets of 4 homogeneous points 2 | 3 | import matplotlib.pyplot as plt 4 | import numpy as np 5 | import matplotlib.image as mpimage 6 | import cv2 7 | import time 8 | 9 | def findH(ipPoints,opPoints): 10 | 'Computer the H matrix (3x3) between 2 sets of matched homogeneous co-ordinates' 11 | 12 | # computing the A matrix to calculate Ah = 0 13 | A = [] 14 | for x1,x2 in zip(ipPoints,opPoints): 15 | 16 | a_x = [-x1[0], -x1[1], -1, 0, 0, 0, x2[0]*x1[0], x2[0]*x1[1], x2[0] ] 17 | a_y = [ 0,0,0, -x1[0], -x1[1], -1, x2[1]*x1[0], x2[1]*x1[1], x2[1] ] 18 | A.append(a_x) 19 | A.append(a_y) 20 | 21 | A = np.array(A) 22 | 23 | # finding SVD of A 24 | u,s,v = np.linalg.svd(A) 25 | #taking the column corresponding to the smallest singular value 26 | h = v[8] 27 | #rearranging in 3x3 format 28 | H = np.array([ [h[0],h[1],h[2]], [h[3],h[4],h[5]], [h[6],h[7],h[8]] ]) 29 | return H 30 | 31 | def cameraPoseFromHomography(H): 32 | 'Estimate the camera pose from the homography' 33 | H1 = H[:,0] 34 | H2 = H[:,1] 35 | H3 = np.cross(H1, H2) 36 | 37 | norm1 = np.linalg.norm(H1) 38 | norm2 = np.linalg.norm(H2) 39 | tnorm = (norm1 + norm2)/2.0 40 | 41 | T = H[:,2]/tnorm 42 | return np.mat([H1, H2, H3, T]) 43 | 44 | def main(): 45 | 46 | imgInput = cv2.imread('testImg2.jpg',cv2.IMREAD_GRAYSCALE) 47 | ipPoints = [[203, 178], [390, 184], [210, 298], [423, 306]] 48 | opPoints = [ [0,0],[100,0],[0,100],[100,100] ] 49 | 50 | #for pt in ipPoints: 51 | # cv2.circle(imgInput, tuple(pt), 2, color=(255,0,0)) 52 | 53 | #cv2.imshow('input', imgInput) 54 | #cv2.waitKey(0) 55 | H = findH(ipPoints, opPoints) 56 | print cameraPoseFromHomography(H) 57 | 58 | #print imgInput.shape 59 | #print 'printing tuple of values' 60 | imgOutput = np.zeros((100,100)) 61 | xmax = max([pt[0] for pt in ipPoints]) 62 | xmin = min([pt[0] for pt in ipPoints]) 63 | ymax = max([pt[1] for pt in ipPoints]) 64 | ymin = min([pt[1] for pt in ipPoints]) 65 | 66 | it = np.nditer(imgInput,flags = ['multi_index']) 67 | while not it.finished: 68 | pt = it.multi_index 69 | if pt[0]>=ymin and pt[0]<=ymax and pt[1]>=xmin and pt[1]<=xmax: 70 | pt1 = np.array([pt[1],pt[0],1]) 71 | pt2_homo = np.dot(H,np.transpose(pt1)) 72 | pt2 = pt2_homo/pt2_homo[2] 73 | pt2 = np.asarray(pt2[0:2],dtype='int32') 74 | if pt2[0]>0 and pt2[0]<100 and pt2[1]>0 and pt2[1]<100: 75 | imgOutput[pt2[1],pt2[0]] = imgInput[pt[0],pt[1]] 76 | 77 | 78 | it.iternext() 79 | 80 | cv2.imwrite('outputFile3.png', imgOutput) 81 | 82 | if __name__ == '__main__': 83 | main() -------------------------------------------------------------------------------- /VREP QuadCopter Class/vrepConst.py: -------------------------------------------------------------------------------- 1 | # This file is part of the REMOTE API 2 | # 3 | # Copyright 2006-2016 Coppelia Robotics GmbH. All rights reserved. 4 | # marc@coppeliarobotics.com 5 | # www.coppeliarobotics.com 6 | # 7 | # The REMOTE API is licensed under the terms of GNU GPL: 8 | # 9 | # ------------------------------------------------------------------- 10 | # The REMOTE API is free software: you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation, either version 3 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # THE REMOTE API IS DISTRIBUTED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 16 | # WARRANTY. THE USER WILL USE IT AT HIS/HER OWN RISK. THE ORIGINAL 17 | # AUTHORS AND COPPELIA ROBOTICS GMBH WILL NOT BE LIABLE FOR DATA LOSS, 18 | # DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR 19 | # MISUSING THIS SOFTWARE. 20 | # 21 | # See the GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with the REMOTE API. If not, see . 25 | # ------------------------------------------------------------------- 26 | # 27 | # This file was automatically created for V-REP release V3.3.0 on February 19th 2016 28 | 29 | #constants 30 | #Scene object types. Values are serialized 31 | sim_object_shape_type =0 32 | sim_object_joint_type =1 33 | sim_object_graph_type =2 34 | sim_object_camera_type =3 35 | sim_object_dummy_type =4 36 | sim_object_proximitysensor_type =5 37 | sim_object_reserved1 =6 38 | sim_object_reserved2 =7 39 | sim_object_path_type =8 40 | sim_object_visionsensor_type =9 41 | sim_object_volume_type =10 42 | sim_object_mill_type =11 43 | sim_object_forcesensor_type =12 44 | sim_object_light_type =13 45 | sim_object_mirror_type =14 46 | 47 | #General object types. Values are serialized 48 | sim_appobj_object_type =109 49 | sim_appobj_collision_type =110 50 | sim_appobj_distance_type =111 51 | sim_appobj_simulation_type =112 52 | sim_appobj_ik_type =113 53 | sim_appobj_constraintsolver_type=114 54 | sim_appobj_collection_type =115 55 | sim_appobj_ui_type =116 56 | sim_appobj_script_type =117 57 | sim_appobj_pathplanning_type =118 58 | sim_appobj_RESERVED_type =119 59 | sim_appobj_texture_type =120 60 | 61 | # Ik calculation methods. Values are serialized 62 | sim_ik_pseudo_inverse_method =0 63 | sim_ik_damped_least_squares_method =1 64 | sim_ik_jacobian_transpose_method =2 65 | 66 | # Ik constraints. Values are serialized 67 | sim_ik_x_constraint =1 68 | sim_ik_y_constraint =2 69 | sim_ik_z_constraint =4 70 | sim_ik_alpha_beta_constraint=8 71 | sim_ik_gamma_constraint =16 72 | sim_ik_avoidance_constraint =64 73 | 74 | # Ik calculation results 75 | sim_ikresult_not_performed =0 76 | sim_ikresult_success =1 77 | sim_ikresult_fail =2 78 | 79 | # Scene object sub-types. Values are serialized 80 | # Light sub-types 81 | sim_light_omnidirectional_subtype =1 82 | sim_light_spot_subtype =2 83 | sim_light_directional_subtype =3 84 | # Joint sub-types 85 | sim_joint_revolute_subtype =10 86 | sim_joint_prismatic_subtype =11 87 | sim_joint_spherical_subtype =12 88 | # Shape sub-types 89 | sim_shape_simpleshape_subtype =20 90 | sim_shape_multishape_subtype =21 91 | # Proximity sensor sub-types 92 | sim_proximitysensor_pyramid_subtype =30 93 | sim_proximitysensor_cylinder_subtype=31 94 | sim_proximitysensor_disc_subtype =32 95 | sim_proximitysensor_cone_subtype =33 96 | sim_proximitysensor_ray_subtype =34 97 | # Mill sub-types 98 | sim_mill_pyramid_subtype =40 99 | sim_mill_cylinder_subtype =41 100 | sim_mill_disc_subtype =42 101 | sim_mill_cone_subtype =42 102 | # No sub-type 103 | sim_object_no_subtype =200 104 | 105 | 106 | #Scene object main properties (serialized) 107 | sim_objectspecialproperty_collidable =0x0001 108 | sim_objectspecialproperty_measurable =0x0002 109 | #reserved =0x0004 110 | #reserved =0x0008 111 | sim_objectspecialproperty_detectable_ultrasonic =0x0010 112 | sim_objectspecialproperty_detectable_infrared =0x0020 113 | sim_objectspecialproperty_detectable_laser =0x0040 114 | sim_objectspecialproperty_detectable_inductive =0x0080 115 | sim_objectspecialproperty_detectable_capacitive =0x0100 116 | sim_objectspecialproperty_renderable =0x0200 117 | sim_objectspecialproperty_detectable_all =sim_objectspecialproperty_detectable_ultrasonic|sim_objectspecialproperty_detectable_infrared|sim_objectspecialproperty_detectable_laser|sim_objectspecialproperty_detectable_inductive|sim_objectspecialproperty_detectable_capacitive 118 | sim_objectspecialproperty_cuttable =0x0400 119 | sim_objectspecialproperty_pathplanning_ignored =0x0800 120 | 121 | # Model properties (serialized) 122 | sim_modelproperty_not_collidable =0x0001 123 | sim_modelproperty_not_measurable =0x0002 124 | sim_modelproperty_not_renderable =0x0004 125 | sim_modelproperty_not_detectable =0x0008 126 | sim_modelproperty_not_cuttable =0x0010 127 | sim_modelproperty_not_dynamic =0x0020 128 | sim_modelproperty_not_respondable =0x0040 # cannot be selected if sim_modelproperty_not_dynamic is not selected 129 | sim_modelproperty_not_reset =0x0080 # Model is not reset at simulation end. This flag is cleared at simulation end 130 | sim_modelproperty_not_visible =0x0100 # Whole model is invisible independent of local visibility settings 131 | sim_modelproperty_not_model =0xf000 # object is not a model 132 | 133 | 134 | # Check the documentation instead of comments below!! 135 | # Following messages are dispatched to the Lua-message container 136 | sim_message_ui_button_state_change =0 # a UI button slider etc. changed (due to a user's action). aux[0]=UI handle aux[1]=button handle aux[2]=button attributes aux[3]=slider position (if slider) 137 | sim_message_reserved9 =1 # Do not use 138 | sim_message_object_selection_changed=2 139 | sim_message_reserved10 =3 # do not use 140 | sim_message_model_loaded =4 141 | sim_message_reserved11 =5 # do not use 142 | sim_message_keypress =6 # a key was pressed while the focus was on a page (aux[0]=key aux[1]=ctrl and shift key state) 143 | sim_message_bannerclicked =7 # a banner was clicked (aux[0]=banner ID) 144 | 145 | 146 | # Following messages are dispatched only to the C-API (not available from Lua) 147 | sim_message_for_c_api_only_start =0x100 # Do not use 148 | sim_message_reserved1 =0x101 # Do not use 149 | sim_message_reserved2 =0x102 # Do not use 150 | sim_message_reserved3 =0x103 # Do not use 151 | sim_message_eventcallback_scenesave =0x104 # about to save a scene 152 | sim_message_eventcallback_modelsave =0x105 # about to save a model (current selection will be saved) 153 | sim_message_eventcallback_moduleopen =0x106 # called when simOpenModule in Lua is called 154 | sim_message_eventcallback_modulehandle =0x107 # called when simHandleModule in Lua is called with argument false 155 | sim_message_eventcallback_moduleclose =0x108 # called when simCloseModule in Lua is called 156 | sim_message_reserved4 =0x109 # Do not use 157 | sim_message_reserved5 =0x10a # Do not use 158 | sim_message_reserved6 =0x10b # Do not use 159 | sim_message_reserved7 =0x10c # Do not use 160 | sim_message_eventcallback_instancepass =0x10d # Called once every main application loop pass. auxiliaryData[0] contains event flags of events that happened since last time 161 | sim_message_eventcallback_broadcast =0x10e 162 | sim_message_eventcallback_imagefilter_enumreset =0x10f 163 | sim_message_eventcallback_imagefilter_enumerate =0x110 164 | sim_message_eventcallback_imagefilter_adjustparams =0x111 165 | sim_message_eventcallback_imagefilter_reserved =0x112 166 | sim_message_eventcallback_imagefilter_process =0x113 167 | sim_message_eventcallback_reserved1 =0x114 # do not use 168 | sim_message_eventcallback_reserved2 =0x115 # do not use 169 | sim_message_eventcallback_reserved3 =0x116 # do not use 170 | sim_message_eventcallback_reserved4 =0x117 # do not use 171 | sim_message_eventcallback_abouttoundo =0x118 # the undo button was hit and a previous state is about to be restored 172 | sim_message_eventcallback_undoperformed =0x119 # the undo button was hit and a previous state restored 173 | sim_message_eventcallback_abouttoredo =0x11a # the redo button was hit and a future state is about to be restored 174 | sim_message_eventcallback_redoperformed =0x11b # the redo button was hit and a future state restored 175 | sim_message_eventcallback_scripticondblclick =0x11c # scipt icon was double clicked. (aux[0]=object handle associated with script set replyData[0] to 1 if script should not be opened) 176 | sim_message_eventcallback_simulationabouttostart =0x11d 177 | sim_message_eventcallback_simulationended =0x11e 178 | sim_message_eventcallback_reserved5 =0x11f # do not use 179 | sim_message_eventcallback_keypress =0x120 # a key was pressed while the focus was on a page (aux[0]=key aux[1]=ctrl and shift key state) 180 | sim_message_eventcallback_modulehandleinsensingpart =0x121 # called when simHandleModule in Lua is called with argument true 181 | sim_message_eventcallback_renderingpass =0x122 # called just before the scene is rendered 182 | sim_message_eventcallback_bannerclicked =0x123 # called when a banner was clicked (aux[0]=banner ID) 183 | sim_message_eventcallback_menuitemselected =0x124 # auxiliaryData[0] indicates the handle of the item auxiliaryData[1] indicates the state of the item 184 | sim_message_eventcallback_refreshdialogs =0x125 # aux[0]=refresh degree (0=light 1=medium 2=full) 185 | sim_message_eventcallback_sceneloaded =0x126 186 | sim_message_eventcallback_modelloaded =0x127 187 | sim_message_eventcallback_instanceswitch =0x128 188 | sim_message_eventcallback_guipass =0x129 189 | sim_message_eventcallback_mainscriptabouttobecalled =0x12a 190 | sim_message_eventcallback_rmlposition =0x12b #the command simRMLPosition was called. The appropriate plugin should handle the call 191 | sim_message_eventcallback_rmlvelocity =0x12c # the command simRMLVelocity was called. The appropriate plugin should handle the call 192 | sim_message_simulation_start_resume_request =0x1000 193 | sim_message_simulation_pause_request =0x1001 194 | sim_message_simulation_stop_request =0x1002 195 | 196 | # Scene object properties. Combine with the | operator 197 | sim_objectproperty_reserved1 =0x0000 198 | sim_objectproperty_reserved2 =0x0001 199 | sim_objectproperty_reserved3 =0x0002 200 | sim_objectproperty_reserved4 =0x0003 201 | sim_objectproperty_reserved5 =0x0004 # formely sim_objectproperty_visible 202 | sim_objectproperty_reserved6 =0x0008 # formely sim_objectproperty_wireframe 203 | sim_objectproperty_collapsed =0x0010 204 | sim_objectproperty_selectable =0x0020 205 | sim_objectproperty_reserved7 =0x0040 206 | sim_objectproperty_selectmodelbaseinstead =0x0080 207 | sim_objectproperty_dontshowasinsidemodel =0x0100 208 | # reserved =0x0200 209 | sim_objectproperty_canupdatedna =0x0400 210 | sim_objectproperty_selectinvisible =0x0800 211 | sim_objectproperty_depthinvisible =0x1000 212 | 213 | 214 | # type of arguments (input and output) for custom lua commands 215 | sim_lua_arg_nil =0 216 | sim_lua_arg_bool =1 217 | sim_lua_arg_int =2 218 | sim_lua_arg_float =3 219 | sim_lua_arg_string =4 220 | sim_lua_arg_invalid =5 221 | sim_lua_arg_table =8 222 | 223 | # custom user interface properties. Values are serialized. 224 | sim_ui_property_visible =0x0001 225 | sim_ui_property_visibleduringsimulationonly =0x0002 226 | sim_ui_property_moveable =0x0004 227 | sim_ui_property_relativetoleftborder =0x0008 228 | sim_ui_property_relativetotopborder =0x0010 229 | sim_ui_property_fixedwidthfont =0x0020 230 | sim_ui_property_systemblock =0x0040 231 | sim_ui_property_settocenter =0x0080 232 | sim_ui_property_rolledup =0x0100 233 | sim_ui_property_selectassociatedobject =0x0200 234 | sim_ui_property_visiblewhenobjectselected =0x0400 235 | 236 | 237 | # button properties. Values are serialized. 238 | sim_buttonproperty_button =0x0000 239 | sim_buttonproperty_label =0x0001 240 | sim_buttonproperty_slider =0x0002 241 | sim_buttonproperty_editbox =0x0003 242 | sim_buttonproperty_staydown =0x0008 243 | sim_buttonproperty_enabled =0x0010 244 | sim_buttonproperty_borderless =0x0020 245 | sim_buttonproperty_horizontallycentered =0x0040 246 | sim_buttonproperty_ignoremouse =0x0080 247 | sim_buttonproperty_isdown =0x0100 248 | sim_buttonproperty_transparent =0x0200 249 | sim_buttonproperty_nobackgroundcolor =0x0400 250 | sim_buttonproperty_rollupaction =0x0800 251 | sim_buttonproperty_closeaction =0x1000 252 | sim_buttonproperty_verticallycentered =0x2000 253 | sim_buttonproperty_downupevent =0x4000 254 | 255 | 256 | # Simulation status 257 | sim_simulation_stopped =0x00 # Simulation is stopped 258 | sim_simulation_paused =0x08 # Simulation is paused 259 | sim_simulation_advancing =0x10 # Simulation is advancing 260 | sim_simulation_advancing_firstafterstop =sim_simulation_advancing|0x00 # First simulation pass (1x) 261 | sim_simulation_advancing_running =sim_simulation_advancing|0x01 # Normal simulation pass (>=1x) 262 | # reserved =sim_simulation_advancing|0x02 263 | sim_simulation_advancing_lastbeforepause =sim_simulation_advancing|0x03 # Last simulation pass before pause (1x) 264 | sim_simulation_advancing_firstafterpause =sim_simulation_advancing|0x04 # First simulation pass after pause (1x) 265 | sim_simulation_advancing_abouttostop =sim_simulation_advancing|0x05 # "Trying to stop" simulation pass (>=1x) 266 | sim_simulation_advancing_lastbeforestop =sim_simulation_advancing|0x06 # Last simulation pass (1x) 267 | 268 | 269 | # Script execution result (first return value) 270 | sim_script_no_error =0 271 | sim_script_main_script_nonexistent =1 272 | sim_script_main_script_not_called =2 273 | sim_script_reentrance_error =4 274 | sim_script_lua_error =8 275 | sim_script_call_error =16 276 | 277 | 278 | # Script types (serialized!) 279 | sim_scripttype_mainscript =0 280 | sim_scripttype_childscript =1 281 | sim_scripttype_jointctrlcallback =4 282 | sim_scripttype_contactcallback =5 283 | sim_scripttype_customizationscript =6 284 | sim_scripttype_generalcallback =7 285 | 286 | # API call error messages 287 | sim_api_errormessage_ignore =0 # does not memorize nor output errors 288 | sim_api_errormessage_report =1 # memorizes errors (default for C-API calls) 289 | sim_api_errormessage_output =2 # memorizes and outputs errors (default for Lua-API calls) 290 | 291 | 292 | # special argument of some functions 293 | sim_handle_all =-2 294 | sim_handle_all_except_explicit =-3 295 | sim_handle_self =-4 296 | sim_handle_main_script =-5 297 | sim_handle_tree =-6 298 | sim_handle_chain =-7 299 | sim_handle_single =-8 300 | sim_handle_default =-9 301 | sim_handle_all_except_self =-10 302 | sim_handle_parent =-11 303 | 304 | 305 | # special handle flags 306 | sim_handleflag_assembly =0x400000 307 | sim_handleflag_model =0x800000 308 | 309 | 310 | # distance calculation methods (serialized) 311 | sim_distcalcmethod_dl =0 312 | sim_distcalcmethod_dac =1 313 | sim_distcalcmethod_max_dl_dac =2 314 | sim_distcalcmethod_dl_and_dac =3 315 | sim_distcalcmethod_sqrt_dl2_and_dac2=4 316 | sim_distcalcmethod_dl_if_nonzero =5 317 | sim_distcalcmethod_dac_if_nonzero =6 318 | 319 | 320 | # Generic dialog styles 321 | sim_dlgstyle_message =0 322 | sim_dlgstyle_input =1 323 | sim_dlgstyle_ok =2 324 | sim_dlgstyle_ok_cancel =3 325 | sim_dlgstyle_yes_no =4 326 | sim_dlgstyle_dont_center =32# can be combined with one of above values. Only with this flag can the position of the related UI be set just after dialog creation 327 | 328 | # Generic dialog return values 329 | sim_dlgret_still_open =0 330 | sim_dlgret_ok =1 331 | sim_dlgret_cancel =2 332 | sim_dlgret_yes =3 333 | sim_dlgret_no =4 334 | 335 | 336 | # Path properties 337 | sim_pathproperty_show_line =0x0001 338 | sim_pathproperty_show_orientation =0x0002 339 | sim_pathproperty_closed_path =0x0004 340 | sim_pathproperty_automatic_orientation =0x0008 341 | sim_pathproperty_invert_velocity =0x0010 342 | sim_pathproperty_infinite_acceleration =0x0020 343 | sim_pathproperty_flat_path =0x0040 344 | sim_pathproperty_show_position =0x0080 345 | sim_pathproperty_auto_velocity_profile_translation =0x0100 346 | sim_pathproperty_auto_velocity_profile_rotation =0x0200 347 | sim_pathproperty_endpoints_at_zero =0x0400 348 | sim_pathproperty_keep_x_up =0x0800 349 | 350 | 351 | # drawing objects 352 | # following are mutually exclusive 353 | sim_drawing_points =0 # 3 values per point (point size in pixels) 354 | sim_drawing_lines =1 # 6 values per line (line size in pixels) 355 | sim_drawing_triangles =2 # 9 values per triangle 356 | sim_drawing_trianglepoints =3 # 6 values per point (3 for triangle position 3 for triangle normal vector) (triangle size in meters) 357 | sim_drawing_quadpoints =4 # 6 values per point (3 for quad position 3 for quad normal vector) (quad size in meters) 358 | sim_drawing_discpoints =5 # 6 values per point (3 for disc position 3 for disc normal vector) (disc size in meters) 359 | sim_drawing_cubepoints =6 # 6 values per point (3 for cube position 3 for cube normal vector) (cube size in meters) 360 | sim_drawing_spherepoints =7 # 3 values per point (sphere size in meters) 361 | 362 | # following can be or-combined 363 | sim_drawing_itemcolors =0x00020 # +3 values per item (each item has its own ambient color (rgb values)). 364 | # Mutually exclusive with sim_drawing_vertexcolors 365 | sim_drawing_vertexcolors =0x00040 # +3 values per vertex (each vertex has its own ambient color (rgb values). Only for sim_drawing_lines (+6) and for sim_drawing_triangles(+9)). Mutually exclusive with sim_drawing_itemcolors 366 | sim_drawing_itemsizes =0x00080 # +1 value per item (each item has its own size). Not for sim_drawing_triangles 367 | sim_drawing_backfaceculling =0x00100 # back faces are not displayed for all items 368 | sim_drawing_wireframe =0x00200 # all items displayed in wireframe 369 | sim_drawing_painttag =0x00400 # all items are tagged as paint (for additinal processing at a later stage) 370 | sim_drawing_followparentvisibility =0x00800 # if the object is associated with a scene object then it follows that visibility otherwise it is always visible 371 | sim_drawing_cyclic =0x01000 # if the max item count was reached then the first items are overwritten. 372 | sim_drawing_50percenttransparency =0x02000 # the drawing object will be 50% transparent 373 | sim_drawing_25percenttransparency =0x04000 # the drawing object will be 25% transparent 374 | sim_drawing_12percenttransparency =0x08000 # the drawing object will be 12.5% transparent 375 | sim_drawing_emissioncolor =0x10000 # When used in combination with sim_drawing_itemcolors or sim_drawing_vertexcolors then the specified colors will be for the emissive component 376 | sim_drawing_facingcamera =0x20000 # Only for trianglepoints quadpoints discpoints and cubepoints. If specified the normal verctor is calculated to face the camera (each item data requires 3 values less) 377 | sim_drawing_overlay =0x40000 # When specified objects are always drawn on top of "regular objects" 378 | sim_drawing_itemtransparency =0x80000 # +1 value per item (each item has its own transparency value (0-1)). Not compatible with sim_drawing_vertexcolors 379 | 380 | # banner values 381 | # following can be or-combined 382 | sim_banner_left =0x00001 # Banners display on the left of the specified point 383 | sim_banner_right =0x00002 # Banners display on the right of the specified point 384 | sim_banner_nobackground =0x00004 # Banners have no background rectangle 385 | sim_banner_overlay =0x00008 # When specified banners are always drawn on top of "regular objects" 386 | sim_banner_followparentvisibility =0x00010 # if the object is associated with a scene object then it follows that visibility otherwise it is always visible 387 | sim_banner_clickselectsparent =0x00020 # if the object is associated with a scene object then clicking the banner will select the scene object 388 | sim_banner_clicktriggersevent =0x00040 # if the banner is clicked an event is triggered (sim_message_eventcallback_bannerclicked and sim_message_bannerclicked are generated) 389 | sim_banner_facingcamera =0x00080 # If specified the banner will always face the camera by rotating around the banner's vertical axis (y-axis) 390 | sim_banner_fullyfacingcamera =0x00100 # If specified the banner will always fully face the camera (the banner's orientation is same as the camera looking at it) 391 | sim_banner_backfaceculling =0x00200 # If specified the banner will only be visible from one side 392 | sim_banner_keepsamesize =0x00400 # If specified the banner will always appear in the same size. In that case size represents the character height in pixels 393 | sim_banner_bitmapfont =0x00800 # If specified a fixed-size bitmap font is used. The text will also always fully face the camera and be right 394 | # to the specified position. Bitmap fonts are not clickable 395 | 396 | 397 | # particle objects following are mutually exclusive 398 | sim_particle_points1 =0 # 6 values per point (pt1 and pt2. Pt1 is start position pt2-pt1 is the initial velocity vector). i 399 | #Point is 1 pixel big. Only appearance is a point internally handled as a perfect sphere 400 | sim_particle_points2 =1 # 6 values per point. Point is 2 pixel big. Only appearance is a point internally handled as a perfect sphere 401 | sim_particle_points4 =2 # 6 values per point. Point is 4 pixel big. Only appearance is a point internally handled as a perfect sphere 402 | sim_particle_roughspheres =3 # 6 values per sphere. Only appearance is rough. Internally a perfect sphere 403 | sim_particle_spheres =4 # 6 values per sphere. Internally a perfect sphere 404 | 405 | 406 | 407 | 408 | # following can be or-combined 409 | sim_particle_respondable1to4 =0x0020 # the particles are respondable against shapes (against all objects that have at least one bit 1-4 activated in the global respondable mask) 410 | sim_particle_respondable5to8 =0x0040 # the particles are respondable against shapes (against all objects that have at least one bit 5-8 activated in the global respondable mask) 411 | sim_particle_particlerespondable =0x0080 # the particles are respondable against each other 412 | sim_particle_ignoresgravity =0x0100 # the particles ignore the effect of gravity. Not compatible with sim_particle_water 413 | sim_particle_invisible =0x0200 # the particles are invisible 414 | sim_particle_itemsizes =0x0400 # +1 value per particle (each particle can have a different size) 415 | sim_particle_itemdensities =0x0800 # +1 value per particle (each particle can have a different density) 416 | sim_particle_itemcolors =0x1000 # +3 values per particle (each particle can have a different color) 417 | sim_particle_cyclic =0x2000 # if the max item count was reached then the first items are overwritten. 418 | sim_particle_emissioncolor =0x4000 # When used in combination with sim_particle_itemcolors then the specified colors will be for the emissive component 419 | sim_particle_water =0x8000 # the particles are water particles (no weight in the water (i.e. when z<0)). Not compatible with sim_particle_ignoresgravity 420 | sim_particle_painttag =0x10000 # The particles can be seen by vision sensors (sim_particle_invisible must not be set) 421 | 422 | 423 | 424 | 425 | # custom user interface menu attributes 426 | sim_ui_menu_title =1 427 | sim_ui_menu_minimize =2 428 | sim_ui_menu_close =4 429 | sim_ui_menu_systemblock =8 430 | 431 | 432 | 433 | # Boolean parameters 434 | sim_boolparam_hierarchy_visible =0 435 | sim_boolparam_console_visible =1 436 | sim_boolparam_collision_handling_enabled =2 437 | sim_boolparam_distance_handling_enabled =3 438 | sim_boolparam_ik_handling_enabled =4 439 | sim_boolparam_gcs_handling_enabled =5 440 | sim_boolparam_dynamics_handling_enabled =6 441 | sim_boolparam_joint_motion_handling_enabled =7 442 | sim_boolparam_path_motion_handling_enabled =8 443 | sim_boolparam_proximity_sensor_handling_enabled =9 444 | sim_boolparam_vision_sensor_handling_enabled =10 445 | sim_boolparam_mill_handling_enabled =11 446 | sim_boolparam_browser_visible =12 447 | sim_boolparam_scene_and_model_load_messages =13 448 | sim_reserved0 =14 449 | sim_boolparam_shape_textures_are_visible =15 450 | sim_boolparam_display_enabled =16 451 | sim_boolparam_infotext_visible =17 452 | sim_boolparam_statustext_open =18 453 | sim_boolparam_fog_enabled =19 454 | sim_boolparam_rml2_available =20 455 | sim_boolparam_rml4_available =21 456 | sim_boolparam_mirrors_enabled =22 457 | sim_boolparam_aux_clip_planes_enabled =23 458 | sim_boolparam_full_model_copy_from_api =24 459 | sim_boolparam_realtime_simulation =25 460 | sim_boolparam_force_show_wireless_emission =27 461 | sim_boolparam_force_show_wireless_reception =28 462 | sim_boolparam_video_recording_triggered =29 463 | sim_boolparam_threaded_rendering_enabled =32 464 | sim_boolparam_fullscreen =33 465 | sim_boolparam_headless =34 466 | sim_boolparam_hierarchy_toolbarbutton_enabled =35 467 | sim_boolparam_browser_toolbarbutton_enabled =36 468 | sim_boolparam_objectshift_toolbarbutton_enabled =37 469 | sim_boolparam_objectrotate_toolbarbutton_enabled=38 470 | sim_boolparam_force_calcstruct_all_visible =39 471 | sim_boolparam_force_calcstruct_all =40 472 | sim_boolparam_exit_request =41 473 | sim_boolparam_play_toolbarbutton_enabled =42 474 | sim_boolparam_pause_toolbarbutton_enabled =43 475 | sim_boolparam_stop_toolbarbutton_enabled =44 476 | sim_boolparam_waiting_for_trigger =45 477 | 478 | 479 | # Integer parameters 480 | sim_intparam_error_report_mode =0 # Check sim_api_errormessage_... constants above for valid values 481 | sim_intparam_program_version =1 # e.g Version 2.1.4 --> 20104. Can only be read 482 | sim_intparam_instance_count =2 # do not use anymore (always returns 1 since V-REP 2.5.11) 483 | sim_intparam_custom_cmd_start_id =3 # can only be read 484 | sim_intparam_compilation_version =4 # 0=evaluation version 1=full version 2=player version. Can only be read 485 | sim_intparam_current_page =5 486 | sim_intparam_flymode_camera_handle =6 # can only be read 487 | sim_intparam_dynamic_step_divider =7 # can only be read 488 | sim_intparam_dynamic_engine =8 # 0=Bullet 1=ODE. 2=Vortex. 489 | sim_intparam_server_port_start =9 # can only be read 490 | sim_intparam_server_port_range =10 # can only be read 491 | sim_intparam_visible_layers =11 492 | sim_intparam_infotext_style =12 493 | sim_intparam_settings =13 494 | sim_intparam_edit_mode_type =14 # can only be read 495 | sim_intparam_server_port_next =15 # is initialized at sim_intparam_server_port_start 496 | sim_intparam_qt_version =16 # version of the used Qt framework 497 | sim_intparam_event_flags_read =17 # can only be read 498 | sim_intparam_event_flags_read_clear =18 # can only be read 499 | sim_intparam_platform =19 # can only be read 500 | sim_intparam_scene_unique_id =20 # can only be read 501 | sim_intparam_work_thread_count =21 502 | sim_intparam_mouse_x =22 503 | sim_intparam_mouse_y =23 504 | sim_intparam_core_count =24 505 | sim_intparam_work_thread_calc_time_ms =25 506 | sim_intparam_idle_fps =26 507 | sim_intparam_prox_sensor_select_down =27 508 | sim_intparam_prox_sensor_select_up =28 509 | sim_intparam_stop_request_counter =29 510 | sim_intparam_program_revision =30 511 | sim_intparam_mouse_buttons =31 512 | sim_intparam_dynamic_warning_disabled_mask =32 513 | sim_intparam_simulation_warning_disabled_mask =33 514 | sim_intparam_scene_index =34 515 | sim_intparam_motionplanning_seed =35 516 | sim_intparam_speedmodifier =36 517 | 518 | # Float parameters 519 | sim_floatparam_rand=0 # random value (0.0-1.0) 520 | sim_floatparam_simulation_time_step =1 521 | sim_floatparam_stereo_distance =2 522 | 523 | # String parameters 524 | sim_stringparam_application_path=0 # path of V-REP's executable 525 | sim_stringparam_video_filename=1 526 | sim_stringparam_app_arg1 =2 527 | sim_stringparam_app_arg2 =3 528 | sim_stringparam_app_arg3 =4 529 | sim_stringparam_app_arg4 =5 530 | sim_stringparam_app_arg5 =6 531 | sim_stringparam_app_arg6 =7 532 | sim_stringparam_app_arg7 =8 533 | sim_stringparam_app_arg8 =9 534 | sim_stringparam_app_arg9 =10 535 | sim_stringparam_scene_path_and_name =13 536 | 537 | # Array parameters 538 | sim_arrayparam_gravity =0 539 | sim_arrayparam_fog =1 540 | sim_arrayparam_fog_color =2 541 | sim_arrayparam_background_color1=3 542 | sim_arrayparam_background_color2=4 543 | sim_arrayparam_ambient_light =5 544 | sim_arrayparam_random_euler =6 545 | 546 | 547 | # User interface elements 548 | sim_gui_menubar =0x0001 549 | sim_gui_popups =0x0002 550 | sim_gui_toolbar1 =0x0004 551 | sim_gui_toolbar2 =0x0008 552 | sim_gui_hierarchy =0x0010 553 | sim_gui_infobar =0x0020 554 | sim_gui_statusbar =0x0040 555 | sim_gui_scripteditor =0x0080 556 | sim_gui_scriptsimulationparameters =0x0100 557 | sim_gui_dialogs =0x0200 558 | sim_gui_browser =0x0400 559 | sim_gui_all =0xffff 560 | 561 | 562 | # Joint modes 563 | sim_jointmode_passive =0 564 | sim_jointmode_motion =1 565 | sim_jointmode_ik =2 566 | sim_jointmode_ikdependent =3 567 | sim_jointmode_dependent =4 568 | sim_jointmode_force =5 569 | 570 | 571 | # Navigation and selection modes with the mouse. Lower byte values are mutually exclusive upper byte bits can be combined 572 | sim_navigation_passive =0x0000 573 | sim_navigation_camerashift =0x0001 574 | sim_navigation_camerarotate =0x0002 575 | sim_navigation_camerazoom =0x0003 576 | sim_navigation_cameratilt =0x0004 577 | sim_navigation_cameraangle =0x0005 578 | sim_navigation_camerafly =0x0006 579 | sim_navigation_objectshift =0x0007 580 | sim_navigation_objectrotate =0x0008 581 | sim_navigation_reserved2 =0x0009 582 | sim_navigation_reserved3 =0x000A 583 | sim_navigation_jointpathtest =0x000B 584 | sim_navigation_ikmanip =0x000C 585 | sim_navigation_objectmultipleselection =0x000D 586 | # Bit-combine following values and add them to one of above's values for a valid navigation mode 587 | sim_navigation_reserved4 =0x0100 588 | sim_navigation_clickselection =0x0200 589 | sim_navigation_ctrlselection =0x0400 590 | sim_navigation_shiftselection =0x0800 591 | sim_navigation_camerazoomwheel =0x1000 592 | sim_navigation_camerarotaterightbutton =0x2000 593 | 594 | 595 | 596 | #Remote API constants 597 | SIMX_VERSION =0 598 | # Remote API message header structure 599 | SIMX_HEADER_SIZE =18 600 | simx_headeroffset_crc =0 # 1 simxUShort. Generated by the client or server. The CRC for the message 601 | simx_headeroffset_version =2 # 1 byte. Generated by the client or server. The version of the remote API software 602 | simx_headeroffset_message_id =3 # 1 simxInt. Generated by the client (and used in a reply by the server) 603 | simx_headeroffset_client_time =7 # 1 simxInt. Client time stamp generated by the client (and sent back by the server) 604 | simx_headeroffset_server_time =11 # 1 simxInt. Generated by the server when a reply is generated. The server timestamp 605 | simx_headeroffset_scene_id =15 # 1 simxUShort. Generated by the server. A unique ID identifying the scene currently displayed 606 | simx_headeroffset_server_state =17 # 1 byte. Generated by the server. Bit coded 0 set --> simulation not stopped 1 set --> simulation paused 2 set --> real-time switch on 3-5 edit mode type (0=no edit mode 1=triangle 2=vertex 3=edge 4=path 5=UI) 607 | 608 | # Remote API command header 609 | SIMX_SUBHEADER_SIZE =26 610 | simx_cmdheaderoffset_mem_size =0 # 1 simxInt. Generated by the client or server. The buffer size of the command. 611 | simx_cmdheaderoffset_full_mem_size =4 # 1 simxInt. Generated by the client or server. The full buffer size of the command (applies to split chunks). 612 | simx_cmdheaderoffset_pdata_offset0 =8 # 1 simxUShort. Generated by the client or server. The amount of data that is part of the command identification. 613 | simx_cmdheaderoffset_pdata_offset1 =10 # 1 simxInt. Generated by the client or server. The amount of shift of the pure data buffer (applies to split chunks). 614 | simx_cmdheaderoffset_cmd=14 # 1 simxInt. Generated by the client (and used in a reply by the server). The command combined with the operation mode of the command. 615 | simx_cmdheaderoffset_delay_or_split =18 # 1 simxUShort. Generated by the client or server. The amount of delay in ms of a continuous command or the max. pure data size to send at once (applies to split commands). 616 | simx_cmdheaderoffset_sim_time =20 # 1 simxInt. Generated by the server. The simulation time (in ms) when the command was executed (or 0 if simulation is not running) 617 | simx_cmdheaderoffset_status =24 # 1 byte. Generated by the server. (1 bit 0 is set --> error in function execution on server side). The client writes bit 1 if command cannot be overwritten 618 | simx_cmdheaderoffset_reserved =25 # 1 byte. Not yet used 619 | 620 | 621 | 622 | 623 | 624 | # Regular operation modes 625 | simx_opmode_oneshot =0x000000 # sends command as one chunk. Reply will also come as one chunk. Doesn't wait for the reply. 626 | simx_opmode_blocking =0x010000 # sends command as one chunk. Reply will also come as one chunk. Waits for the reply (_REPLY_WAIT_TIMEOUT_IN_MS is the timeout). 627 | simx_opmode_oneshot_wait =0x010000 # sends command as one chunk. Reply will also come as one chunk. Waits for the reply (_REPLY_WAIT_TIMEOUT_IN_MS is the timeout). 628 | simx_opmode_continuous =0x020000 629 | simx_opmode_streaming =0x020000 # sends command as one chunk. Command will be stored on the server and always executed 630 | #(every x ms (as far as possible) where x can be 0-65535. just add x to opmode_continuous). 631 | # A reply will be sent continuously each time as one chunk. Doesn't wait for the reply. 632 | 633 | # Operation modes for heavy data 634 | simx_opmode_oneshot_split =0x030000 # sends command as several chunks (max chunk size is x bytes where x can be _MIN_SPLIT_AMOUNT_IN_BYTES-65535. Just add x to opmode_oneshot_split). Reply will also come as several chunks. Doesn't wait for the reply. 635 | simx_opmode_continuous_split =0x040000 636 | simx_opmode_streaming_split =0x040000 # sends command as several chunks (max chunk size is x bytes where x can be _MIN_SPLIT_AMOUNT_IN_BYTES-65535. Just add x to opmode_continuous_split). Command will be stored on the server and always executed. A reply will be sent continuously each time as several chunks. Doesn't wait for the reply. 637 | 638 | # Special operation modes 639 | simx_opmode_discontinue =0x050000 # removes and cancels all commands stored on the client or server side (also continuous commands) 640 | simx_opmode_buffer =0x060000 # doesn't send anything but checks if a reply for the given command is available in the input buffer (i.e. previously received from the server) 641 | simx_opmode_remove =0x070000 # doesn't send anything and doesn't return any specific value. It just erases a similar command reply in the inbox (to free some memory) 642 | 643 | 644 | # Command return codes 645 | simx_return_ok =0x000000 646 | simx_return_novalue_flag =0x000001 # input buffer doesn't contain the specified command 647 | simx_return_timeout_flag =0x000002 # command reply not received in time for opmode_oneshot_wait operation mode 648 | simx_return_illegal_opmode_flag =0x000004 # command doesn't support the specified operation mode 649 | simx_return_remote_error_flag =0x000008 # command caused an error on the server side 650 | simx_return_split_progress_flag =0x000010 # previous similar command not yet fully processed (applies to opmode_oneshot_split operation modes) 651 | simx_return_local_error_flag =0x000020 # command caused an error on the client side 652 | simx_return_initialize_error_flag =0x000040 # simxStart was not yet called 653 | 654 | # Following for backward compatibility (same as above) 655 | simx_error_noerror =0x000000 656 | simx_error_novalue_flag =0x000001 # input buffer doesn't contain the specified command 657 | simx_error_timeout_flag =0x000002 # command reply not received in time for opmode_oneshot_wait operation mode 658 | simx_error_illegal_opmode_flag =0x000004 # command doesn't support the specified operation mode 659 | simx_error_remote_error_flag =0x000008 # command caused an error on the server side 660 | simx_error_split_progress_flag =0x000010 # previous similar command not yet fully processed (applies to opmode_oneshot_split operation modes) 661 | simx_error_local_error_flag =0x000020 # command caused an error on the client side 662 | simx_error_initialize_error_flag =0x000040 # simxStart was not yet called 663 | 664 | 665 | -------------------------------------------------------------------------------- /VREP QuadCopter Class/vrep.py: -------------------------------------------------------------------------------- 1 | # This file is part of the REMOTE API 2 | # 3 | # Copyright 2006-2016 Coppelia Robotics GmbH. All rights reserved. 4 | # marc@coppeliarobotics.com 5 | # www.coppeliarobotics.com 6 | # 7 | # The REMOTE API is licensed under the terms of GNU GPL: 8 | # 9 | # ------------------------------------------------------------------- 10 | # The REMOTE API is free software: you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation, either version 3 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # THE REMOTE API IS DISTRIBUTED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED 16 | # WARRANTY. THE USER WILL USE IT AT HIS/HER OWN RISK. THE ORIGINAL 17 | # AUTHORS AND COPPELIA ROBOTICS GMBH WILL NOT BE LIABLE FOR DATA LOSS, 18 | # DAMAGES, LOSS OF PROFITS OR ANY OTHER KIND OF LOSS WHILE USING OR 19 | # MISUSING THIS SOFTWARE. 20 | # 21 | # See the GNU General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU General Public License 24 | # along with the REMOTE API. If not, see . 25 | # ------------------------------------------------------------------- 26 | # 27 | # This file was automatically created for V-REP release V3.3.0 on February 19th 2016 28 | 29 | import platform 30 | import struct 31 | import sys 32 | import ctypes as ct 33 | from vrepConst import * 34 | 35 | #load library 36 | libsimx = None 37 | try: 38 | if platform.system() =='cli': 39 | libsimx = ct.CDLL("./remoteApi.dll") 40 | elif platform.system() =='Windows': 41 | libsimx = ct.CDLL("./remoteApi.dll") 42 | elif platform.system() == 'Darwin': 43 | libsimx = ct.CDLL("./remoteApi.dylib") 44 | else: 45 | libsimx = ct.CDLL("./remoteApi.so") 46 | except: 47 | print ('----------------------------------------------------') 48 | print ('The remoteApi library could not be loaded. Make sure') 49 | print ('it is located in the same folder as "vrep.py", or') 50 | print ('appropriately adjust the file "vrep.py"') 51 | print ('----------------------------------------------------') 52 | print ('') 53 | 54 | #ctypes wrapper prototypes 55 | c_GetJointPosition = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetJointPosition", libsimx)) 56 | c_SetJointPosition = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_float, ct.c_int32)(("simxSetJointPosition", libsimx)) 57 | c_GetJointMatrix = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetJointMatrix", libsimx)) 58 | c_SetSphericalJointMatrix = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxSetSphericalJointMatrix", libsimx)) 59 | c_SetJointTargetVelocity = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_float, ct.c_int32)(("simxSetJointTargetVelocity", libsimx)) 60 | c_SetJointTargetPosition = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_float, ct.c_int32)(("simxSetJointTargetPosition", libsimx)) 61 | c_GetJointForce = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetJointForce", libsimx)) 62 | c_SetJointForce = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_float, ct.c_int32)(("simxSetJointForce", libsimx)) 63 | c_ReadForceSensor = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_ubyte), ct.POINTER(ct.c_float), ct.POINTER(ct.c_float), ct.c_int32)(("simxReadForceSensor", libsimx)) 64 | c_BreakForceSensor = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32)(("simxBreakForceSensor", libsimx)) 65 | c_ReadVisionSensor = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_ubyte), ct.POINTER(ct.POINTER(ct.c_float)), ct.POINTER(ct.POINTER(ct.c_int32)), ct.c_int32)(("simxReadVisionSensor", libsimx)) 66 | c_GetObjectHandle = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetObjectHandle", libsimx)) 67 | c_GetVisionSensorImage = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_byte)), ct.c_ubyte, ct.c_int32)(("simxGetVisionSensorImage", libsimx)) 68 | c_SetVisionSensorImage = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_byte), ct.c_int32, ct.c_ubyte, ct.c_int32)(("simxSetVisionSensorImage", libsimx)) 69 | c_GetVisionSensorDepthBuffer= ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_float)), ct.c_int32)(("simxGetVisionSensorDepthBuffer", libsimx)) 70 | c_GetObjectChild = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetObjectChild", libsimx)) 71 | c_GetObjectParent = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetObjectParent", libsimx)) 72 | c_ReadProximitySensor = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_ubyte), ct.POINTER(ct.c_float), ct.POINTER(ct.c_int32), ct.POINTER(ct.c_float), ct.c_int32)(("simxReadProximitySensor", libsimx)) 73 | c_LoadModel = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_ubyte, ct.POINTER(ct.c_int32), ct.c_int32)(("simxLoadModel", libsimx)) 74 | c_LoadUI = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_ubyte, ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_int32)), ct.c_int32)(("simxLoadUI", libsimx)) 75 | c_LoadScene = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_ubyte, ct.c_int32)(("simxLoadScene", libsimx)) 76 | c_StartSimulation = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32)(("simxStartSimulation", libsimx)) 77 | c_PauseSimulation = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32)(("simxPauseSimulation", libsimx)) 78 | c_StopSimulation = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32)(("simxStopSimulation", libsimx)) 79 | c_GetUIHandle = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetUIHandle", libsimx)) 80 | c_GetUISlider = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetUISlider", libsimx)) 81 | c_SetUISlider = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32)(("simxSetUISlider", libsimx)) 82 | c_GetUIEventButton = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetUIEventButton", libsimx)) 83 | c_GetUIButtonProperty = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetUIButtonProperty", libsimx)) 84 | c_SetUIButtonProperty = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32)(("simxSetUIButtonProperty", libsimx)) 85 | c_AddStatusbarMessage = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32)(("simxAddStatusbarMessage", libsimx)) 86 | c_AuxiliaryConsoleOpen = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.POINTER(ct.c_int32), ct.POINTER(ct.c_float), ct.POINTER(ct.c_float), ct.POINTER(ct.c_int32), ct.c_int32)(("simxAuxiliaryConsoleOpen", libsimx)) 87 | c_AuxiliaryConsoleClose = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32)(("simxAuxiliaryConsoleClose", libsimx)) 88 | c_AuxiliaryConsolePrint = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32)(("simxAuxiliaryConsolePrint", libsimx)) 89 | c_AuxiliaryConsoleShow = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_ubyte, ct.c_int32)(("simxAuxiliaryConsoleShow", libsimx)) 90 | c_GetObjectOrientation = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetObjectOrientation", libsimx)) 91 | c_GetObjectPosition = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetObjectPosition", libsimx)) 92 | c_SetObjectOrientation = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxSetObjectOrientation", libsimx)) 93 | c_SetObjectPosition = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxSetObjectPosition", libsimx)) 94 | c_SetObjectParent = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.c_ubyte, ct.c_int32)(("simxSetObjectParent", libsimx)) 95 | c_SetUIButtonLabel = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_char), ct.c_int32)(("simxSetUIButtonLabel", libsimx)) 96 | c_GetLastErrors = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_char)), ct.c_int32)(("simxGetLastErrors", libsimx)) 97 | c_GetArrayParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetArrayParameter", libsimx)) 98 | c_SetArrayParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxSetArrayParameter", libsimx)) 99 | c_GetBooleanParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_ubyte), ct.c_int32)(("simxGetBooleanParameter", libsimx)) 100 | c_SetBooleanParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_ubyte, ct.c_int32)(("simxSetBooleanParameter", libsimx)) 101 | c_GetIntegerParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetIntegerParameter", libsimx)) 102 | c_SetIntegerParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32)(("simxSetIntegerParameter", libsimx)) 103 | c_GetFloatingParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetFloatingParameter", libsimx)) 104 | c_SetFloatingParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_float, ct.c_int32)(("simxSetFloatingParameter", libsimx)) 105 | c_GetStringParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.POINTER(ct.c_char)), ct.c_int32)(("simxGetStringParameter", libsimx)) 106 | c_GetCollisionHandle = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetCollisionHandle", libsimx)) 107 | c_GetDistanceHandle = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetDistanceHandle", libsimx)) 108 | c_GetCollectionHandle = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetCollectionHandle", libsimx)) 109 | c_ReadCollision = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_ubyte), ct.c_int32)(("simxReadCollision", libsimx)) 110 | c_ReadDistance = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxReadDistance", libsimx)) 111 | c_RemoveObject = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32)(("simxRemoveObject", libsimx)) 112 | c_RemoveModel = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32)(("simxRemoveModel", libsimx)) 113 | c_RemoveUI = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32)(("simxRemoveUI", libsimx)) 114 | c_CloseScene = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32)(("simxCloseScene", libsimx)) 115 | c_GetObjects = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_int32)), ct.c_int32)(("simxGetObjects", libsimx)) 116 | c_DisplayDialog = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_char), ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_float), ct.POINTER(ct.c_float), ct.POINTER(ct.c_int32), ct.POINTER(ct.c_int32), ct.c_int32)(("simxDisplayDialog", libsimx)) 117 | c_EndDialog = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32)(("simxEndDialog", libsimx)) 118 | c_GetDialogInput = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.POINTER(ct.c_char)), ct.c_int32)(("simxGetDialogInput", libsimx)) 119 | c_GetDialogResult = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetDialogResult", libsimx)) 120 | c_CopyPasteObjects = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32, ct.POINTER(ct.POINTER(ct.c_int32)), ct.POINTER(ct.c_int32), ct.c_int32)(("simxCopyPasteObjects", libsimx)) 121 | c_GetObjectSelection = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.POINTER(ct.c_int32)), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetObjectSelection", libsimx)) 122 | c_SetObjectSelection = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32, ct.c_int32)(("simxSetObjectSelection", libsimx)) 123 | c_ClearFloatSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32)(("simxClearFloatSignal", libsimx)) 124 | c_ClearIntegerSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32)(("simxClearIntegerSignal", libsimx)) 125 | c_ClearStringSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32)(("simxClearStringSignal", libsimx)) 126 | c_GetFloatSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_float), ct.c_int32)(("simxGetFloatSignal", libsimx)) 127 | c_GetIntegerSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetIntegerSignal", libsimx)) 128 | c_GetStringSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.POINTER(ct.c_ubyte)), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetStringSignal", libsimx)) 129 | c_SetFloatSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_float, ct.c_int32)(("simxSetFloatSignal", libsimx)) 130 | c_SetIntegerSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32, ct.c_int32)(("simxSetIntegerSignal", libsimx)) 131 | c_SetStringSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_ubyte), ct.c_int32, ct.c_int32)(("simxSetStringSignal", libsimx)) 132 | c_AppendStringSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_ubyte), ct.c_int32, ct.c_int32)(("simxAppendStringSignal", libsimx)) 133 | c_WriteStringStream = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_ubyte), ct.c_int32, ct.c_int32)(("simxWriteStringStream", libsimx)) 134 | c_GetObjectFloatParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.c_int32)(("simxGetObjectFloatParameter", libsimx)) 135 | c_SetObjectFloatParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.c_float, ct.c_int32)(("simxSetObjectFloatParameter", libsimx)) 136 | c_GetObjectIntParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetObjectIntParameter", libsimx)) 137 | c_SetObjectIntParameter = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32)(("simxSetObjectIntParameter", libsimx)) 138 | c_GetModelProperty = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetModelProperty", libsimx)) 139 | c_SetModelProperty = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.c_int32)(("simxSetModelProperty", libsimx)) 140 | c_Start = ct.CFUNCTYPE(ct.c_int32,ct.POINTER(ct.c_char), ct.c_int32, ct.c_ubyte, ct.c_ubyte, ct.c_int32, ct.c_int32)(("simxStart", libsimx)) 141 | c_Finish = ct.CFUNCTYPE(None, ct.c_int32)(("simxFinish", libsimx)) 142 | c_GetPingTime = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_int32))(("simxGetPingTime", libsimx)) 143 | c_GetLastCmdTime = ct.CFUNCTYPE(ct.c_int32,ct.c_int32)(("simxGetLastCmdTime", libsimx)) 144 | c_SynchronousTrigger = ct.CFUNCTYPE(ct.c_int32,ct.c_int32)(("simxSynchronousTrigger", libsimx)) 145 | c_Synchronous = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_ubyte)(("simxSynchronous", libsimx)) 146 | c_PauseCommunication = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_ubyte)(("simxPauseCommunication", libsimx)) 147 | c_GetInMessageInfo = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32))(("simxGetInMessageInfo", libsimx)) 148 | c_GetOutMessageInfo = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32))(("simxGetOutMessageInfo", libsimx)) 149 | c_GetConnectionId = ct.CFUNCTYPE(ct.c_int32,ct.c_int32)(("simxGetConnectionId", libsimx)) 150 | c_CreateBuffer = ct.CFUNCTYPE(ct.POINTER(ct.c_ubyte), ct.c_int32)(("simxCreateBuffer", libsimx)) 151 | c_ReleaseBuffer = ct.CFUNCTYPE(None, ct.c_void_p)(("simxReleaseBuffer", libsimx)) 152 | c_TransferFile = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_char), ct.c_int32, ct.c_int32)(("simxTransferFile", libsimx)) 153 | c_EraseFile = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.c_int32)(("simxEraseFile", libsimx)) 154 | c_GetAndClearStringSignal = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.POINTER(ct.c_ubyte)), ct.POINTER(ct.c_int32), ct.c_int32)(("simxGetAndClearStringSignal", libsimx)) 155 | c_ReadStringStream = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.POINTER(ct.c_ubyte)), ct.POINTER(ct.c_int32), ct.c_int32)(("simxReadStringStream", libsimx)) 156 | c_CreateDummy = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_float, ct.POINTER(ct.c_ubyte), ct.POINTER(ct.c_int32), ct.c_int32)(("simxCreateDummy", libsimx)) 157 | c_Query = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.c_ubyte), ct.c_int32, ct.POINTER(ct.c_char), ct.POINTER(ct.POINTER(ct.c_ubyte)), ct.POINTER(ct.c_int32), ct.c_int32)(("simxQuery", libsimx)) 158 | c_GetObjectGroupData = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.c_int32, ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_int32)), ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_int32)), ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_float)), ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_char)), ct.c_int32)(("simxGetObjectGroupData", libsimx)) 159 | c_GetObjectVelocity = ct.CFUNCTYPE(ct.c_int32,ct.c_int32, ct.c_int32, ct.POINTER(ct.c_float), ct.POINTER(ct.c_float), ct.c_int32)(("simxGetObjectVelocity", libsimx)) 160 | c_CallScriptFunction = ct.CFUNCTYPE(ct.c_int32,ct.c_int32,ct.POINTER(ct.c_char),ct.c_int32,ct.POINTER(ct.c_char),ct.c_int32,ct.POINTER(ct.c_int32),ct.c_int32,ct.POINTER(ct.c_float),ct.c_int32,ct.POINTER(ct.c_char),ct.c_int32,ct.POINTER(ct.c_ubyte),ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_int32)),ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_float)),ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_char)),ct.POINTER(ct.c_int32), ct.POINTER(ct.POINTER(ct.c_ubyte)),ct.c_int32)(("simxCallScriptFunction", libsimx)) 161 | 162 | #API functions 163 | def simxGetJointPosition(clientID, jointHandle, operationMode): 164 | ''' 165 | Please have a look at the function description/documentation in the V-REP user manual 166 | ''' 167 | position = ct.c_float() 168 | return c_GetJointPosition(clientID, jointHandle, ct.byref(position), operationMode), position.value 169 | 170 | def simxSetJointPosition(clientID, jointHandle, position, operationMode): 171 | ''' 172 | Please have a look at the function description/documentation in the V-REP user manual 173 | ''' 174 | 175 | return c_SetJointPosition(clientID, jointHandle, position, operationMode) 176 | 177 | def simxGetJointMatrix(clientID, jointHandle, operationMode): 178 | ''' 179 | Please have a look at the function description/documentation in the V-REP user manual 180 | ''' 181 | matrix = (ct.c_float*12)() 182 | ret = c_GetJointMatrix(clientID, jointHandle, matrix, operationMode) 183 | arr = [] 184 | for i in range(12): 185 | arr.append(matrix[i]) 186 | return ret, arr 187 | 188 | def simxSetSphericalJointMatrix(clientID, jointHandle, matrix, operationMode): 189 | ''' 190 | Please have a look at the function description/documentation in the V-REP user manual 191 | ''' 192 | matrix = (ct.c_float*12)(*matrix) 193 | return c_SetSphericalJointMatrix(clientID, jointHandle, matrix, operationMode) 194 | 195 | def simxSetJointTargetVelocity(clientID, jointHandle, targetVelocity, operationMode): 196 | ''' 197 | Please have a look at the function description/documentation in the V-REP user manual 198 | ''' 199 | 200 | return c_SetJointTargetVelocity(clientID, jointHandle, targetVelocity, operationMode) 201 | 202 | def simxSetJointTargetPosition(clientID, jointHandle, targetPosition, operationMode): 203 | ''' 204 | Please have a look at the function description/documentation in the V-REP user manual 205 | ''' 206 | 207 | return c_SetJointTargetPosition(clientID, jointHandle, targetPosition, operationMode) 208 | 209 | def simxJointGetForce(clientID, jointHandle, operationMode): 210 | ''' 211 | Please have a look at the function description/documentation in the V-REP user manual 212 | ''' 213 | force = ct.c_float() 214 | return c_GetJointForce(clientID, jointHandle, ct.byref(force), operationMode), force.value 215 | 216 | def simxGetJointForce(clientID, jointHandle, operationMode): 217 | ''' 218 | Please have a look at the function description/documentation in the V-REP user manual 219 | ''' 220 | force = ct.c_float() 221 | return c_GetJointForce(clientID, jointHandle, ct.byref(force), operationMode), force.value 222 | 223 | def simxSetJointForce(clientID, jointHandle, force, operationMode): 224 | ''' 225 | Please have a look at the function description/documentation in the V-REP user manual 226 | ''' 227 | return c_SetJointForce(clientID, jointHandle, force, operationMode) 228 | 229 | def simxReadForceSensor(clientID, forceSensorHandle, operationMode): 230 | ''' 231 | Please have a look at the function description/documentation in the V-REP user manual 232 | ''' 233 | state = ct.c_ubyte() 234 | forceVector = (ct.c_float*3)() 235 | torqueVector = (ct.c_float*3)() 236 | ret = c_ReadForceSensor(clientID, forceSensorHandle, ct.byref(state), forceVector, torqueVector, operationMode) 237 | arr1 = [] 238 | for i in range(3): 239 | arr1.append(forceVector[i]) 240 | arr2 = [] 241 | for i in range(3): 242 | arr2.append(torqueVector[i]) 243 | if sys.version_info[0] == 3: 244 | state=state.value 245 | else: 246 | state=ord(state.value) 247 | return ret, state, arr1, arr2 248 | 249 | def simxBreakForceSensor(clientID, forceSensorHandle, operationMode): 250 | ''' 251 | Please have a look at the function description/documentation in the V-REP user manual 252 | ''' 253 | return c_BreakForceSensor(clientID, forceSensorHandle, operationMode) 254 | 255 | def simxReadVisionSensor(clientID, sensorHandle, operationMode): 256 | ''' 257 | Please have a look at the function description/documentation in the V-REP user manual 258 | ''' 259 | 260 | detectionState = ct.c_ubyte() 261 | auxValues = ct.POINTER(ct.c_float)() 262 | auxValuesCount = ct.POINTER(ct.c_int)() 263 | ret = c_ReadVisionSensor(clientID, sensorHandle, ct.byref(detectionState), ct.byref(auxValues), ct.byref(auxValuesCount), operationMode) 264 | 265 | auxValues2 = [] 266 | if ret == 0: 267 | s = 0 268 | for i in range(auxValuesCount[0]): 269 | auxValues2.append(auxValues[s:s+auxValuesCount[i+1]]) 270 | s += auxValuesCount[i+1] 271 | 272 | #free C buffers 273 | c_ReleaseBuffer(auxValues) 274 | c_ReleaseBuffer(auxValuesCount) 275 | 276 | return ret, bool(detectionState.value!=0), auxValues2 277 | 278 | def simxGetObjectHandle(clientID, objectName, operationMode): 279 | ''' 280 | Please have a look at the function description/documentation in the V-REP user manual 281 | ''' 282 | handle = ct.c_int() 283 | if (sys.version_info[0] == 3) and (type(objectName) is str): 284 | objectName=objectName.encode('utf-8') 285 | return c_GetObjectHandle(clientID, objectName, ct.byref(handle), operationMode), handle.value 286 | 287 | def simxGetVisionSensorImage(clientID, sensorHandle, options, operationMode): 288 | ''' 289 | Please have a look at the function description/documentation in the V-REP user manual 290 | ''' 291 | 292 | resolution = (ct.c_int*2)() 293 | c_image = ct.POINTER(ct.c_byte)() 294 | bytesPerPixel = 3 295 | if (options and 1) != 0: 296 | bytesPerPixel = 1 297 | ret = c_GetVisionSensorImage(clientID, sensorHandle, resolution, ct.byref(c_image), options, operationMode) 298 | 299 | reso = [] 300 | image = [] 301 | if (ret == 0): 302 | image = [None]*resolution[0]*resolution[1]*bytesPerPixel 303 | for i in range(resolution[0] * resolution[1] * bytesPerPixel): 304 | image[i] = c_image[i] 305 | for i in range(2): 306 | reso.append(resolution[i]) 307 | return ret, reso, image 308 | 309 | def simxSetVisionSensorImage(clientID, sensorHandle, image, options, operationMode): 310 | ''' 311 | Please have a look at the function description/documentation in the V-REP user manual 312 | ''' 313 | size = len(image) 314 | image_bytes = (ct.c_byte*size)(*image) 315 | return c_SetVisionSensorImage(clientID, sensorHandle, image_bytes, size, options, operationMode) 316 | 317 | def simxGetVisionSensorDepthBuffer(clientID, sensorHandle, operationMode): 318 | ''' 319 | Please have a look at the function description/documentation in the V-REP user manual 320 | ''' 321 | c_buffer = ct.POINTER(ct.c_float)() 322 | resolution = (ct.c_int*2)() 323 | ret = c_GetVisionSensorDepthBuffer(clientID, sensorHandle, resolution, ct.byref(c_buffer), operationMode) 324 | reso = [] 325 | buffer = [] 326 | if (ret == 0): 327 | buffer = [None]*resolution[0]*resolution[1] 328 | for i in range(resolution[0] * resolution[1]): 329 | buffer[i] = c_buffer[i] 330 | for i in range(2): 331 | reso.append(resolution[i]) 332 | return ret, reso, buffer 333 | 334 | def simxGetObjectChild(clientID, parentObjectHandle, childIndex, operationMode): 335 | ''' 336 | Please have a look at the function description/documentation in the V-REP user manual 337 | ''' 338 | childObjectHandle = ct.c_int() 339 | return c_GetObjectChild(clientID, parentObjectHandle, childIndex, ct.byref(childObjectHandle), operationMode), childObjectHandle.value 340 | 341 | def simxGetObjectParent(clientID, childObjectHandle, operationMode): 342 | ''' 343 | Please have a look at the function description/documentation in the V-REP user manual 344 | ''' 345 | 346 | parentObjectHandle = ct.c_int() 347 | return c_GetObjectParent(clientID, childObjectHandle, ct.byref(parentObjectHandle), operationMode), parentObjectHandle.value 348 | 349 | def simxReadProximitySensor(clientID, sensorHandle, operationMode): 350 | ''' 351 | Please have a look at the function description/documentation in the V-REP user manual 352 | ''' 353 | 354 | detectionState = ct.c_ubyte() 355 | detectedObjectHandle = ct.c_int() 356 | detectedPoint = (ct.c_float*3)() 357 | detectedSurfaceNormalVector = (ct.c_float*3)() 358 | ret = c_ReadProximitySensor(clientID, sensorHandle, ct.byref(detectionState), detectedPoint, ct.byref(detectedObjectHandle), detectedSurfaceNormalVector, operationMode) 359 | arr1 = [] 360 | for i in range(3): 361 | arr1.append(detectedPoint[i]) 362 | arr2 = [] 363 | for i in range(3): 364 | arr2.append(detectedSurfaceNormalVector[i]) 365 | return ret, bool(detectionState.value!=0), arr1, detectedObjectHandle.value, arr2 366 | 367 | def simxLoadModel(clientID, modelPathAndName, options, operationMode): 368 | ''' 369 | Please have a look at the function description/documentation in the V-REP user manual 370 | ''' 371 | baseHandle = ct.c_int() 372 | if (sys.version_info[0] == 3) and (type(modelPathAndName) is str): 373 | modelPathAndName=modelPathAndName.encode('utf-8') 374 | return c_LoadModel(clientID, modelPathAndName, options, ct.byref(baseHandle), operationMode), baseHandle.value 375 | 376 | def simxLoadUI(clientID, uiPathAndName, options, operationMode): 377 | ''' 378 | Please have a look at the function description/documentation in the V-REP user manual 379 | ''' 380 | 381 | count = ct.c_int() 382 | uiHandles = ct.POINTER(ct.c_int)() 383 | if (sys.version_info[0] == 3) and (type(uiPathAndName) is str): 384 | uiPathAndName=uiPathAndName.encode('utf-8') 385 | ret = c_LoadUI(clientID, uiPathAndName, options, ct.byref(count), ct.byref(uiHandles), operationMode) 386 | 387 | handles = [] 388 | if ret == 0: 389 | for i in range(count.value): 390 | handles.append(uiHandles[i]) 391 | #free C buffers 392 | c_ReleaseBuffer(uiHandles) 393 | 394 | return ret, handles 395 | 396 | def simxLoadScene(clientID, scenePathAndName, options, operationMode): 397 | ''' 398 | Please have a look at the function description/documentation in the V-REP user manual 399 | ''' 400 | 401 | if (sys.version_info[0] == 3) and (type(scenePathAndName) is str): 402 | scenePathAndName=scenePathAndName.encode('utf-8') 403 | return c_LoadScene(clientID, scenePathAndName, options, operationMode) 404 | 405 | def simxStartSimulation(clientID, operationMode): 406 | ''' 407 | Please have a look at the function description/documentation in the V-REP user manual 408 | ''' 409 | 410 | return c_StartSimulation(clientID, operationMode) 411 | 412 | def simxPauseSimulation(clientID, operationMode): 413 | ''' 414 | Please have a look at the function description/documentation in the V-REP user manual 415 | ''' 416 | 417 | return c_PauseSimulation(clientID, operationMode) 418 | 419 | def simxStopSimulation(clientID, operationMode): 420 | ''' 421 | Please have a look at the function description/documentation in the V-REP user manual 422 | ''' 423 | 424 | return c_StopSimulation(clientID, operationMode) 425 | 426 | def simxGetUIHandle(clientID, uiName, operationMode): 427 | ''' 428 | Please have a look at the function description/documentation in the V-REP user manual 429 | ''' 430 | 431 | handle = ct.c_int() 432 | if (sys.version_info[0] == 3) and (type(uiName) is str): 433 | uiName=uiName.encode('utf-8') 434 | return c_GetUIHandle(clientID, uiName, ct.byref(handle), operationMode), handle.value 435 | 436 | def simxGetUISlider(clientID, uiHandle, uiButtonID, operationMode): 437 | ''' 438 | Please have a look at the function description/documentation in the V-REP user manual 439 | ''' 440 | 441 | position = ct.c_int() 442 | return c_GetUISlider(clientID, uiHandle, uiButtonID, ct.byref(position), operationMode), position.value 443 | 444 | def simxSetUISlider(clientID, uiHandle, uiButtonID, position, operationMode): 445 | ''' 446 | Please have a look at the function description/documentation in the V-REP user manual 447 | ''' 448 | 449 | return c_SetUISlider(clientID, uiHandle, uiButtonID, position, operationMode) 450 | 451 | def simxGetUIEventButton(clientID, uiHandle, operationMode): 452 | ''' 453 | Please have a look at the function description/documentation in the V-REP user manual 454 | ''' 455 | 456 | uiEventButtonID = ct.c_int() 457 | auxValues = (ct.c_int*2)() 458 | ret = c_GetUIEventButton(clientID, uiHandle, ct.byref(uiEventButtonID), auxValues, operationMode) 459 | arr = [] 460 | for i in range(2): 461 | arr.append(auxValues[i]) 462 | return ret, uiEventButtonID.value, arr 463 | 464 | def simxGetUIButtonProperty(clientID, uiHandle, uiButtonID, operationMode): 465 | ''' 466 | Please have a look at the function description/documentation in the V-REP user manual 467 | ''' 468 | 469 | prop = ct.c_int() 470 | return c_GetUIButtonProperty(clientID, uiHandle, uiButtonID, ct.byref(prop), operationMode), prop.value 471 | 472 | def simxSetUIButtonProperty(clientID, uiHandle, uiButtonID, prop, operationMode): 473 | ''' 474 | Please have a look at the function description/documentation in the V-REP user manual 475 | ''' 476 | 477 | return c_SetUIButtonProperty(clientID, uiHandle, uiButtonID, prop, operationMode) 478 | 479 | def simxAddStatusbarMessage(clientID, message, operationMode): 480 | ''' 481 | Please have a look at the function description/documentation in the V-REP user manual 482 | ''' 483 | 484 | if (sys.version_info[0] == 3) and (type(message) is str): 485 | message=message.encode('utf-8') 486 | return c_AddStatusbarMessage(clientID, message, operationMode) 487 | 488 | def simxAuxiliaryConsoleOpen(clientID, title, maxLines, mode, position, size, textColor, backgroundColor, operationMode): 489 | ''' 490 | Please have a look at the function description/documentation in the V-REP user manual 491 | ''' 492 | 493 | consoleHandle = ct.c_int() 494 | if (sys.version_info[0] == 3) and (type(title) is str): 495 | title=title.encode('utf-8') 496 | if position != None: 497 | c_position = (ct.c_int*2)(*position) 498 | else: 499 | c_position = None 500 | if size != None: 501 | c_size = (ct.c_int*2)(*size) 502 | else: 503 | c_size = None 504 | if textColor != None: 505 | c_textColor = (ct.c_float*3)(*textColor) 506 | else: 507 | c_textColor = None 508 | if backgroundColor != None: 509 | c_backgroundColor = (ct.c_float*3)(*backgroundColor) 510 | else: 511 | c_backgroundColor = None 512 | return c_AuxiliaryConsoleOpen(clientID, title, maxLines, mode, c_position, c_size, c_textColor, c_backgroundColor, ct.byref(consoleHandle), operationMode), consoleHandle.value 513 | 514 | def simxAuxiliaryConsoleClose(clientID, consoleHandle, operationMode): 515 | ''' 516 | Please have a look at the function description/documentation in the V-REP user manual 517 | ''' 518 | 519 | return c_AuxiliaryConsoleClose(clientID, consoleHandle, operationMode) 520 | 521 | def simxAuxiliaryConsolePrint(clientID, consoleHandle, txt, operationMode): 522 | ''' 523 | Please have a look at the function description/documentation in the V-REP user manual 524 | ''' 525 | 526 | if (sys.version_info[0] == 3) and (type(txt) is str): 527 | txt=txt.encode('utf-8') 528 | return c_AuxiliaryConsolePrint(clientID, consoleHandle, txt, operationMode) 529 | 530 | def simxAuxiliaryConsoleShow(clientID, consoleHandle, showState, operationMode): 531 | ''' 532 | Please have a look at the function description/documentation in the V-REP user manual 533 | ''' 534 | 535 | return c_AuxiliaryConsoleShow(clientID, consoleHandle, showState, operationMode) 536 | 537 | def simxGetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, operationMode): 538 | ''' 539 | Please have a look at the function description/documentation in the V-REP user manual 540 | ''' 541 | eulerAngles = (ct.c_float*3)() 542 | ret = c_GetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, eulerAngles, operationMode) 543 | arr = [] 544 | for i in range(3): 545 | arr.append(eulerAngles[i]) 546 | return ret, arr 547 | 548 | def simxGetObjectPosition(clientID, objectHandle, relativeToObjectHandle, operationMode): 549 | ''' 550 | Please have a look at the function description/documentation in the V-REP user manual 551 | ''' 552 | position = (ct.c_float*3)() 553 | ret = c_GetObjectPosition(clientID, objectHandle, relativeToObjectHandle, position, operationMode) 554 | arr = [] 555 | for i in range(3): 556 | arr.append(position[i]) 557 | return ret, arr 558 | 559 | def simxSetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, eulerAngles, operationMode): 560 | ''' 561 | Please have a look at the function description/documentation in the V-REP user manual 562 | ''' 563 | 564 | angles = (ct.c_float*3)(*eulerAngles) 565 | return c_SetObjectOrientation(clientID, objectHandle, relativeToObjectHandle, angles, operationMode) 566 | 567 | def simxSetObjectPosition(clientID, objectHandle, relativeToObjectHandle, position, operationMode): 568 | ''' 569 | Please have a look at the function description/documentation in the V-REP user manual 570 | ''' 571 | 572 | c_position = (ct.c_float*3)(*position) 573 | return c_SetObjectPosition(clientID, objectHandle, relativeToObjectHandle, c_position, operationMode) 574 | 575 | def simxSetObjectParent(clientID, objectHandle, parentObject, keepInPlace, operationMode): 576 | ''' 577 | Please have a look at the function description/documentation in the V-REP user manual 578 | ''' 579 | 580 | return c_SetObjectParent(clientID, objectHandle, parentObject, keepInPlace, operationMode) 581 | 582 | def simxSetUIButtonLabel(clientID, uiHandle, uiButtonID, upStateLabel, downStateLabel, operationMode): 583 | ''' 584 | Please have a look at the function description/documentation in the V-REP user manual 585 | ''' 586 | 587 | if sys.version_info[0] == 3: 588 | if type(upStateLabel) is str: 589 | upStateLabel=upStateLabel.encode('utf-8') 590 | if type(downStateLabel) is str: 591 | downStateLabel=downStateLabel.encode('utf-8') 592 | return c_SetUIButtonLabel(clientID, uiHandle, uiButtonID, upStateLabel, downStateLabel, operationMode) 593 | 594 | def simxGetLastErrors(clientID, operationMode): 595 | ''' 596 | Please have a look at the function description/documentation in the V-REP user manual 597 | ''' 598 | errors =[] 599 | errorCnt = ct.c_int() 600 | errorStrings = ct.POINTER(ct.c_char)() 601 | ret = c_GetLastErrors(clientID, ct.byref(errorCnt), ct.byref(errorStrings), operationMode) 602 | if ret == 0: 603 | s = 0 604 | for i in range(errorCnt.value): 605 | a = bytearray() 606 | while errorStrings[s] != b'\0': 607 | if sys.version_info[0] == 3: 608 | a.append(int.from_bytes(errorStrings[s],'big')) 609 | else: 610 | a.append(errorStrings[s]) 611 | s += 1 612 | s += 1 #skip null 613 | if sys.version_info[0] == 3: 614 | errors.append(str(a,'utf-8')) 615 | else: 616 | errors.append(str(a)) 617 | 618 | return ret, errors 619 | 620 | def simxGetArrayParameter(clientID, paramIdentifier, operationMode): 621 | ''' 622 | Please have a look at the function description/documentation in the V-REP user manual 623 | ''' 624 | paramValues = (ct.c_float*3)() 625 | ret = c_GetArrayParameter(clientID, paramIdentifier, paramValues, operationMode) 626 | arr = [] 627 | for i in range(3): 628 | arr.append(paramValues[i]) 629 | return ret, arr 630 | 631 | def simxSetArrayParameter(clientID, paramIdentifier, paramValues, operationMode): 632 | ''' 633 | Please have a look at the function description/documentation in the V-REP user manual 634 | ''' 635 | 636 | c_paramValues = (ct.c_float*3)(*paramValues) 637 | return c_SetArrayParameter(clientID, paramIdentifier, c_paramValues, operationMode) 638 | 639 | def simxGetBooleanParameter(clientID, paramIdentifier, operationMode): 640 | ''' 641 | Please have a look at the function description/documentation in the V-REP user manual 642 | ''' 643 | 644 | paramValue = ct.c_ubyte() 645 | return c_GetBooleanParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode), bool(paramValue.value!=0) 646 | 647 | def simxSetBooleanParameter(clientID, paramIdentifier, paramValue, operationMode): 648 | ''' 649 | Please have a look at the function description/documentation in the V-REP user manual 650 | ''' 651 | 652 | return c_SetBooleanParameter(clientID, paramIdentifier, paramValue, operationMode) 653 | 654 | def simxGetIntegerParameter(clientID, paramIdentifier, operationMode): 655 | ''' 656 | Please have a look at the function description/documentation in the V-REP user manual 657 | ''' 658 | 659 | paramValue = ct.c_int() 660 | return c_GetIntegerParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode), paramValue.value 661 | 662 | def simxSetIntegerParameter(clientID, paramIdentifier, paramValue, operationMode): 663 | ''' 664 | Please have a look at the function description/documentation in the V-REP user manual 665 | ''' 666 | 667 | return c_SetIntegerParameter(clientID, paramIdentifier, paramValue, operationMode) 668 | 669 | def simxGetFloatingParameter(clientID, paramIdentifier, operationMode): 670 | ''' 671 | Please have a look at the function description/documentation in the V-REP user manual 672 | ''' 673 | 674 | paramValue = ct.c_float() 675 | return c_GetFloatingParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode), paramValue.value 676 | 677 | def simxSetFloatingParameter(clientID, paramIdentifier, paramValue, operationMode): 678 | ''' 679 | Please have a look at the function description/documentation in the V-REP user manual 680 | ''' 681 | 682 | return c_SetFloatingParameter(clientID, paramIdentifier, paramValue, operationMode) 683 | 684 | def simxGetStringParameter(clientID, paramIdentifier, operationMode): 685 | ''' 686 | Please have a look at the function description/documentation in the V-REP user manual 687 | ''' 688 | paramValue = ct.POINTER(ct.c_char)() 689 | ret = c_GetStringParameter(clientID, paramIdentifier, ct.byref(paramValue), operationMode) 690 | 691 | a = bytearray() 692 | if ret == 0: 693 | i = 0 694 | while paramValue[i] != b'\0': 695 | if sys.version_info[0] == 3: 696 | a.append(int.from_bytes(paramValue[i],'big')) 697 | else: 698 | a.append(paramValue[i]) 699 | i=i+1 700 | if sys.version_info[0] == 3: 701 | a=str(a,'utf-8') 702 | else: 703 | a=str(a) 704 | return ret, a 705 | 706 | def simxGetCollisionHandle(clientID, collisionObjectName, operationMode): 707 | ''' 708 | Please have a look at the function description/documentation in the V-REP user manual 709 | ''' 710 | 711 | handle = ct.c_int() 712 | if (sys.version_info[0] == 3) and (type(collisionObjectName) is str): 713 | collisionObjectName=collisionObjectName.encode('utf-8') 714 | return c_GetCollisionHandle(clientID, collisionObjectName, ct.byref(handle), operationMode), handle.value 715 | 716 | def simxGetCollectionHandle(clientID, collectionName, operationMode): 717 | ''' 718 | Please have a look at the function description/documentation in the V-REP user manual 719 | ''' 720 | 721 | handle = ct.c_int() 722 | if (sys.version_info[0] == 3) and (type(collectionName) is str): 723 | collectionName=collectionName.encode('utf-8') 724 | return c_GetCollectionHandle(clientID, collectionName, ct.byref(handle), operationMode), handle.value 725 | 726 | def simxGetDistanceHandle(clientID, distanceObjectName, operationMode): 727 | ''' 728 | Please have a look at the function description/documentation in the V-REP user manual 729 | ''' 730 | 731 | handle = ct.c_int() 732 | if (sys.version_info[0] == 3) and (type(distanceObjectName) is str): 733 | distanceObjectName=distanceObjectName.encode('utf-8') 734 | return c_GetDistanceHandle(clientID, distanceObjectName, ct.byref(handle), operationMode), handle.value 735 | 736 | def simxReadCollision(clientID, collisionObjectHandle, operationMode): 737 | ''' 738 | Please have a look at the function description/documentation in the V-REP user manual 739 | ''' 740 | collisionState = ct.c_ubyte() 741 | return c_ReadCollision(clientID, collisionObjectHandle, ct.byref(collisionState), operationMode), bool(collisionState.value!=0) 742 | 743 | def simxReadDistance(clientID, distanceObjectHandle, operationMode): 744 | ''' 745 | Please have a look at the function description/documentation in the V-REP user manual 746 | ''' 747 | 748 | minimumDistance = ct.c_float() 749 | return c_ReadDistance(clientID, distanceObjectHandle, ct.byref(minimumDistance), operationMode), minimumDistance.value 750 | 751 | def simxRemoveObject(clientID, objectHandle, operationMode): 752 | ''' 753 | Please have a look at the function description/documentation in the V-REP user manual 754 | ''' 755 | 756 | return c_RemoveObject(clientID, objectHandle, operationMode) 757 | 758 | def simxRemoveModel(clientID, objectHandle, operationMode): 759 | ''' 760 | Please have a look at the function description/documentation in the V-REP user manual 761 | ''' 762 | 763 | return c_RemoveModel(clientID, objectHandle, operationMode) 764 | 765 | def simxRemoveUI(clientID, uiHandle, operationMode): 766 | ''' 767 | Please have a look at the function description/documentation in the V-REP user manual 768 | ''' 769 | 770 | return c_RemoveUI(clientID, uiHandle, operationMode) 771 | 772 | def simxCloseScene(clientID, operationMode): 773 | ''' 774 | Please have a look at the function description/documentation in the V-REP user manual 775 | ''' 776 | 777 | return c_CloseScene(clientID, operationMode) 778 | 779 | def simxGetObjects(clientID, objectType, operationMode): 780 | ''' 781 | Please have a look at the function description/documentation in the V-REP user manual 782 | ''' 783 | 784 | objectCount = ct.c_int() 785 | objectHandles = ct.POINTER(ct.c_int)() 786 | 787 | ret = c_GetObjects(clientID, objectType, ct.byref(objectCount), ct.byref(objectHandles), operationMode) 788 | handles = [] 789 | if ret == 0: 790 | for i in range(objectCount.value): 791 | handles.append(objectHandles[i]) 792 | 793 | return ret, handles 794 | 795 | 796 | def simxDisplayDialog(clientID, titleText, mainText, dialogType, initialText, titleColors, dialogColors, operationMode): 797 | ''' 798 | Please have a look at the function description/documentation in the V-REP user manual 799 | ''' 800 | if titleColors != None: 801 | c_titleColors = (ct.c_float*6)(*titleColors) 802 | else: 803 | c_titleColors = None 804 | if dialogColors != None: 805 | c_dialogColors = (ct.c_float*6)(*dialogColors) 806 | else: 807 | c_dialogColors = None 808 | 809 | c_dialogHandle = ct.c_int() 810 | c_uiHandle = ct.c_int() 811 | if sys.version_info[0] == 3: 812 | if type(titleText) is str: 813 | titleText=titleText.encode('utf-8') 814 | if type(mainText) is str: 815 | mainText=mainText.encode('utf-8') 816 | if type(initialText) is str: 817 | initialText=initialText.encode('utf-8') 818 | return c_DisplayDialog(clientID, titleText, mainText, dialogType, initialText, c_titleColors, c_dialogColors, ct.byref(c_dialogHandle), ct.byref(c_uiHandle), operationMode), c_dialogHandle.value, c_uiHandle.value 819 | 820 | def simxEndDialog(clientID, dialogHandle, operationMode): 821 | ''' 822 | Please have a look at the function description/documentation in the V-REP user manual 823 | ''' 824 | 825 | return c_EndDialog(clientID, dialogHandle, operationMode) 826 | 827 | def simxGetDialogInput(clientID, dialogHandle, operationMode): 828 | ''' 829 | Please have a look at the function description/documentation in the V-REP user manual 830 | ''' 831 | inputText = ct.POINTER(ct.c_char)() 832 | ret = c_GetDialogInput(clientID, dialogHandle, ct.byref(inputText), operationMode) 833 | 834 | a = bytearray() 835 | if ret == 0: 836 | i = 0 837 | while inputText[i] != b'\0': 838 | if sys.version_info[0] == 3: 839 | a.append(int.from_bytes(inputText[i],'big')) 840 | else: 841 | a.append(inputText[i]) 842 | i = i+1 843 | 844 | if sys.version_info[0] == 3: 845 | a=str(a,'utf-8') 846 | else: 847 | a=str(a) 848 | return ret, a 849 | 850 | 851 | def simxGetDialogResult(clientID, dialogHandle, operationMode): 852 | ''' 853 | Please have a look at the function description/documentation in the V-REP user manual 854 | ''' 855 | result = ct.c_int() 856 | return c_GetDialogResult(clientID, dialogHandle, ct.byref(result), operationMode), result.value 857 | 858 | def simxCopyPasteObjects(clientID, objectHandles, operationMode): 859 | ''' 860 | Please have a look at the function description/documentation in the V-REP user manual 861 | ''' 862 | c_objectHandles = (ct.c_int*len(objectHandles))(*objectHandles) 863 | c_objectHandles = ct.cast(c_objectHandles,ct.POINTER(ct.c_int)) # IronPython needs this 864 | newObjectCount = ct.c_int() 865 | newObjectHandles = ct.POINTER(ct.c_int)() 866 | ret = c_CopyPasteObjects(clientID, c_objectHandles, len(objectHandles), ct.byref(newObjectHandles), ct.byref(newObjectCount), operationMode) 867 | 868 | newobj = [] 869 | if ret == 0: 870 | for i in range(newObjectCount.value): 871 | newobj.append(newObjectHandles[i]) 872 | 873 | return ret, newobj 874 | 875 | 876 | def simxGetObjectSelection(clientID, operationMode): 877 | ''' 878 | Please have a look at the function description/documentation in the V-REP user manual 879 | ''' 880 | objectCount = ct.c_int() 881 | objectHandles = ct.POINTER(ct.c_int)() 882 | ret = c_GetObjectSelection(clientID, ct.byref(objectHandles), ct.byref(objectCount), operationMode) 883 | 884 | newobj = [] 885 | if ret == 0: 886 | for i in range(objectCount.value): 887 | newobj.append(objectHandles[i]) 888 | 889 | return ret, newobj 890 | 891 | 892 | 893 | def simxSetObjectSelection(clientID, objectHandles, operationMode): 894 | ''' 895 | Please have a look at the function description/documentation in the V-REP user manual 896 | ''' 897 | 898 | c_objectHandles = (ct.c_int*len(objectHandles))(*objectHandles) 899 | return c_SetObjectSelection(clientID, c_objectHandles, len(objectHandles), operationMode) 900 | 901 | def simxClearFloatSignal(clientID, signalName, operationMode): 902 | ''' 903 | Please have a look at the function description/documentation in the V-REP user manual 904 | ''' 905 | 906 | if (sys.version_info[0] == 3) and (type(signalName) is str): 907 | signalName=signalName.encode('utf-8') 908 | return c_ClearFloatSignal(clientID, signalName, operationMode) 909 | 910 | def simxClearIntegerSignal(clientID, signalName, operationMode): 911 | ''' 912 | Please have a look at the function description/documentation in the V-REP user manual 913 | ''' 914 | 915 | if (sys.version_info[0] == 3) and (type(signalName) is str): 916 | signalName=signalName.encode('utf-8') 917 | return c_ClearIntegerSignal(clientID, signalName, operationMode) 918 | 919 | def simxClearStringSignal(clientID, signalName, operationMode): 920 | ''' 921 | Please have a look at the function description/documentation in the V-REP user manual 922 | ''' 923 | 924 | if (sys.version_info[0] == 3) and (type(signalName) is str): 925 | signalName=signalName.encode('utf-8') 926 | return c_ClearStringSignal(clientID, signalName, operationMode) 927 | 928 | def simxGetFloatSignal(clientID, signalName, operationMode): 929 | ''' 930 | Please have a look at the function description/documentation in the V-REP user manual 931 | ''' 932 | 933 | signalValue = ct.c_float() 934 | if (sys.version_info[0] == 3) and (type(signalName) is str): 935 | signalName=signalName.encode('utf-8') 936 | return c_GetFloatSignal(clientID, signalName, ct.byref(signalValue), operationMode), signalValue.value 937 | 938 | def simxGetIntegerSignal(clientID, signalName, operationMode): 939 | ''' 940 | Please have a look at the function description/documentation in the V-REP user manual 941 | ''' 942 | 943 | signalValue = ct.c_int() 944 | if (sys.version_info[0] == 3) and (type(signalName) is str): 945 | signalName=signalName.encode('utf-8') 946 | return c_GetIntegerSignal(clientID, signalName, ct.byref(signalValue), operationMode), signalValue.value 947 | 948 | def simxGetStringSignal(clientID, signalName, operationMode): 949 | ''' 950 | Please have a look at the function description/documentation in the V-REP user manual 951 | ''' 952 | 953 | signalLength = ct.c_int(); 954 | signalValue = ct.POINTER(ct.c_ubyte)() 955 | if (sys.version_info[0] == 3) and (type(signalName) is str): 956 | signalName=signalName.encode('utf-8') 957 | ret = c_GetStringSignal(clientID, signalName, ct.byref(signalValue), ct.byref(signalLength), operationMode) 958 | 959 | a = bytearray() 960 | if ret == 0: 961 | for i in range(signalLength.value): 962 | a.append(signalValue[i]) 963 | if sys.version_info[0] != 3: 964 | a=str(a) 965 | 966 | return ret, a 967 | 968 | def simxGetAndClearStringSignal(clientID, signalName, operationMode): 969 | ''' 970 | Please have a look at the function description/documentation in the V-REP user manual 971 | ''' 972 | 973 | signalLength = ct.c_int(); 974 | signalValue = ct.POINTER(ct.c_ubyte)() 975 | if (sys.version_info[0] == 3) and (type(signalName) is str): 976 | signalName=signalName.encode('utf-8') 977 | ret = c_GetAndClearStringSignal(clientID, signalName, ct.byref(signalValue), ct.byref(signalLength), operationMode) 978 | 979 | a = bytearray() 980 | if ret == 0: 981 | for i in range(signalLength.value): 982 | a.append(signalValue[i]) 983 | if sys.version_info[0] != 3: 984 | a=str(a) 985 | 986 | return ret, a 987 | 988 | def simxReadStringStream(clientID, signalName, operationMode): 989 | ''' 990 | Please have a look at the function description/documentation in the V-REP user manual 991 | ''' 992 | 993 | signalLength = ct.c_int(); 994 | signalValue = ct.POINTER(ct.c_ubyte)() 995 | if (sys.version_info[0] == 3) and (type(signalName) is str): 996 | signalName=signalName.encode('utf-8') 997 | ret = c_ReadStringStream(clientID, signalName, ct.byref(signalValue), ct.byref(signalLength), operationMode) 998 | 999 | a = bytearray() 1000 | if ret == 0: 1001 | for i in range(signalLength.value): 1002 | a.append(signalValue[i]) 1003 | if sys.version_info[0] != 3: 1004 | a=str(a) 1005 | 1006 | return ret, a 1007 | 1008 | def simxSetFloatSignal(clientID, signalName, signalValue, operationMode): 1009 | ''' 1010 | Please have a look at the function description/documentation in the V-REP user manual 1011 | ''' 1012 | 1013 | if (sys.version_info[0] == 3) and (type(signalName) is str): 1014 | signalName=signalName.encode('utf-8') 1015 | return c_SetFloatSignal(clientID, signalName, signalValue, operationMode) 1016 | 1017 | def simxSetIntegerSignal(clientID, signalName, signalValue, operationMode): 1018 | ''' 1019 | Please have a look at the function description/documentation in the V-REP user manual 1020 | ''' 1021 | 1022 | if (sys.version_info[0] == 3) and (type(signalName) is str): 1023 | signalName=signalName.encode('utf-8') 1024 | return c_SetIntegerSignal(clientID, signalName, signalValue, operationMode) 1025 | 1026 | def simxSetStringSignal(clientID, signalName, signalValue, operationMode): 1027 | ''' 1028 | Please have a look at the function description/documentation in the V-REP user manual 1029 | ''' 1030 | 1031 | sigV=signalValue 1032 | if sys.version_info[0] == 3: 1033 | if type(signalName) is str: 1034 | signalName=signalName.encode('utf-8') 1035 | if type(signalValue) is bytearray: 1036 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1037 | if type(signalValue) is str: 1038 | signalValue=signalValue.encode('utf-8') 1039 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1040 | else: 1041 | if type(signalValue) is bytearray: 1042 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1043 | if type(signalValue) is str: 1044 | signalValue=bytearray(signalValue) 1045 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1046 | sigV=ct.cast(sigV,ct.POINTER(ct.c_ubyte)) # IronPython needs this 1047 | return c_SetStringSignal(clientID, signalName, sigV, len(signalValue), operationMode) 1048 | 1049 | def simxAppendStringSignal(clientID, signalName, signalValue, operationMode): 1050 | ''' 1051 | Please have a look at the function description/documentation in the V-REP user manual 1052 | ''' 1053 | 1054 | sigV=signalValue 1055 | if sys.version_info[0] == 3: 1056 | if type(signalName) is str: 1057 | signalName=signalName.encode('utf-8') 1058 | if type(signalValue) is bytearray: 1059 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1060 | if type(signalValue) is str: 1061 | signalValue=signalValue.encode('utf-8') 1062 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1063 | else: 1064 | if type(signalValue) is bytearray: 1065 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1066 | if type(signalValue) is str: 1067 | signalValue=bytearray(signalValue) 1068 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1069 | sigV=ct.cast(sigV,ct.POINTER(ct.c_ubyte)) # IronPython needs this 1070 | return c_AppendStringSignal(clientID, signalName, sigV, len(signalValue), operationMode) 1071 | 1072 | def simxWriteStringStream(clientID, signalName, signalValue, operationMode): 1073 | ''' 1074 | Please have a look at the function description/documentation in the V-REP user manual 1075 | ''' 1076 | 1077 | sigV=signalValue 1078 | if sys.version_info[0] == 3: 1079 | if type(signalName) is str: 1080 | signalName=signalName.encode('utf-8') 1081 | if type(signalValue) is bytearray: 1082 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1083 | if type(signalValue) is str: 1084 | signalValue=signalValue.encode('utf-8') 1085 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1086 | else: 1087 | if type(signalValue) is bytearray: 1088 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1089 | if type(signalValue) is str: 1090 | signalValue=bytearray(signalValue) 1091 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1092 | sigV=ct.cast(sigV,ct.POINTER(ct.c_ubyte)) # IronPython needs this 1093 | return c_WriteStringStream(clientID, signalName, sigV, len(signalValue), operationMode) 1094 | 1095 | def simxGetObjectFloatParameter(clientID, objectHandle, parameterID, operationMode): 1096 | ''' 1097 | Please have a look at the function description/documentation in the V-REP user manual 1098 | ''' 1099 | 1100 | parameterValue = ct.c_float() 1101 | return c_GetObjectFloatParameter(clientID, objectHandle, parameterID, ct.byref(parameterValue), operationMode), parameterValue.value 1102 | 1103 | def simxSetObjectFloatParameter(clientID, objectHandle, parameterID, parameterValue, operationMode): 1104 | ''' 1105 | Please have a look at the function description/documentation in the V-REP user manual 1106 | ''' 1107 | 1108 | return c_SetObjectFloatParameter(clientID, objectHandle, parameterID, parameterValue, operationMode) 1109 | 1110 | def simxGetObjectIntParameter(clientID, objectHandle, parameterID, operationMode): 1111 | ''' 1112 | Please have a look at the function description/documentation in the V-REP user manual 1113 | ''' 1114 | 1115 | parameterValue = ct.c_int() 1116 | return c_GetObjectIntParameter(clientID, objectHandle, parameterID, ct.byref(parameterValue), operationMode), parameterValue.value 1117 | 1118 | def simxSetObjectIntParameter(clientID, objectHandle, parameterID, parameterValue, operationMode): 1119 | ''' 1120 | Please have a look at the function description/documentation in the V-REP user manual 1121 | ''' 1122 | 1123 | return c_SetObjectIntParameter(clientID, objectHandle, parameterID, parameterValue, operationMode) 1124 | 1125 | def simxGetModelProperty(clientID, objectHandle, operationMode): 1126 | ''' 1127 | Please have a look at the function description/documentation in the V-REP user manual 1128 | ''' 1129 | prop = ct.c_int() 1130 | return c_GetModelProperty(clientID, objectHandle, ct.byref(prop), operationMode), prop.value 1131 | 1132 | def simxSetModelProperty(clientID, objectHandle, prop, operationMode): 1133 | ''' 1134 | Please have a look at the function description/documentation in the V-REP user manual 1135 | ''' 1136 | 1137 | return c_SetModelProperty(clientID, objectHandle, prop, operationMode) 1138 | 1139 | def simxStart(connectionAddress, connectionPort, waitUntilConnected, doNotReconnectOnceDisconnected, timeOutInMs, commThreadCycleInMs): 1140 | ''' 1141 | Please have a look at the function description/documentation in the V-REP user manual 1142 | ''' 1143 | 1144 | if (sys.version_info[0] == 3) and (type(connectionAddress) is str): 1145 | connectionAddress=connectionAddress.encode('utf-8') 1146 | return c_Start(connectionAddress, connectionPort, waitUntilConnected, doNotReconnectOnceDisconnected, timeOutInMs, commThreadCycleInMs) 1147 | 1148 | def simxFinish(clientID): 1149 | ''' 1150 | Please have a look at the function description/documentation in the V-REP user manual 1151 | ''' 1152 | 1153 | return c_Finish(clientID) 1154 | 1155 | def simxGetPingTime(clientID): 1156 | ''' 1157 | Please have a look at the function description/documentation in the V-REP user manual 1158 | ''' 1159 | pingTime = ct.c_int() 1160 | return c_GetPingTime(clientID, ct.byref(pingTime)), pingTime.value 1161 | 1162 | def simxGetLastCmdTime(clientID): 1163 | ''' 1164 | Please have a look at the function description/documentation in the V-REP user manual 1165 | ''' 1166 | 1167 | return c_GetLastCmdTime(clientID) 1168 | 1169 | def simxSynchronousTrigger(clientID): 1170 | ''' 1171 | Please have a look at the function description/documentation in the V-REP user manual 1172 | ''' 1173 | 1174 | return c_SynchronousTrigger(clientID) 1175 | 1176 | def simxSynchronous(clientID, enable): 1177 | ''' 1178 | Please have a look at the function description/documentation in the V-REP user manual 1179 | ''' 1180 | 1181 | return c_Synchronous(clientID, enable) 1182 | 1183 | def simxPauseCommunication(clientID, enable): 1184 | ''' 1185 | Please have a look at the function description/documentation in the V-REP user manual 1186 | ''' 1187 | 1188 | return c_PauseCommunication(clientID, enable) 1189 | 1190 | def simxGetInMessageInfo(clientID, infoType): 1191 | ''' 1192 | Please have a look at the function description/documentation in the V-REP user manual 1193 | ''' 1194 | info = ct.c_int() 1195 | return c_GetInMessageInfo(clientID, infoType, ct.byref(info)), info.value 1196 | 1197 | def simxGetOutMessageInfo(clientID, infoType): 1198 | ''' 1199 | Please have a look at the function description/documentation in the V-REP user manual 1200 | ''' 1201 | info = ct.c_int() 1202 | return c_GetOutMessageInfo(clientID, infoType, ct.byref(info)), info.value 1203 | 1204 | def simxGetConnectionId(clientID): 1205 | ''' 1206 | Please have a look at the function description/documentation in the V-REP user manual 1207 | ''' 1208 | 1209 | return c_GetConnectionId(clientID) 1210 | 1211 | def simxCreateBuffer(bufferSize): 1212 | ''' 1213 | Please have a look at the function description/documentation in the V-REP user manual 1214 | ''' 1215 | 1216 | return c_CreateBuffer(bufferSize) 1217 | 1218 | def simxReleaseBuffer(buffer): 1219 | ''' 1220 | Please have a look at the function description/documentation in the V-REP user manual 1221 | ''' 1222 | 1223 | return c_ReleaseBuffer(buffer) 1224 | 1225 | def simxTransferFile(clientID, filePathAndName, fileName_serverSide, timeOut, operationMode): 1226 | ''' 1227 | Please have a look at the function description/documentation in the V-REP user manual 1228 | ''' 1229 | 1230 | if (sys.version_info[0] == 3) and (type(filePathAndName) is str): 1231 | filePathAndName=filePathAndName.encode('utf-8') 1232 | return c_TransferFile(clientID, filePathAndName, fileName_serverSide, timeOut, operationMode) 1233 | 1234 | def simxEraseFile(clientID, fileName_serverSide, operationMode): 1235 | ''' 1236 | Please have a look at the function description/documentation in the V-REP user manual 1237 | ''' 1238 | 1239 | if (sys.version_info[0] == 3) and (type(fileName_serverSide) is str): 1240 | fileName_serverSide=fileName_serverSide.encode('utf-8') 1241 | return c_EraseFile(clientID, fileName_serverSide, operationMode) 1242 | 1243 | def simxCreateDummy(clientID, size, color, operationMode): 1244 | ''' 1245 | Please have a look at the function description/documentation in the V-REP user manual 1246 | ''' 1247 | 1248 | handle = ct.c_int() 1249 | if color != None: 1250 | c_color = (ct.c_ubyte*12)(*color) 1251 | else: 1252 | c_color = None 1253 | return c_CreateDummy(clientID, size, c_color, ct.byref(handle), operationMode), handle.value 1254 | 1255 | def simxQuery(clientID, signalName, signalValue, retSignalName, timeOutInMs): 1256 | ''' 1257 | Please have a look at the function description/documentation in the V-REP user manual 1258 | ''' 1259 | 1260 | retSignalLength = ct.c_int(); 1261 | retSignalValue = ct.POINTER(ct.c_ubyte)() 1262 | 1263 | sigV=signalValue 1264 | if sys.version_info[0] == 3: 1265 | if type(signalName) is str: 1266 | signalName=signalName.encode('utf-8') 1267 | if type(retSignalName) is str: 1268 | retSignalName=retSignalName.encode('utf-8') 1269 | if type(signalValue) is bytearray: 1270 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1271 | if type(signalValue) is str: 1272 | signalValue=signalValue.encode('utf-8') 1273 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1274 | else: 1275 | if type(signalValue) is bytearray: 1276 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1277 | if type(signalValue) is str: 1278 | signalValue=bytearray(signalValue) 1279 | sigV = (ct.c_ubyte*len(signalValue))(*signalValue) 1280 | sigV=ct.cast(sigV,ct.POINTER(ct.c_ubyte)) # IronPython needs this 1281 | 1282 | ret = c_Query(clientID, signalName, sigV, len(signalValue), retSignalName, ct.byref(retSignalValue), ct.byref(retSignalLength), timeOutInMs) 1283 | 1284 | a = bytearray() 1285 | if ret == 0: 1286 | for i in range(retSignalLength.value): 1287 | a.append(retSignalValue[i]) 1288 | if sys.version_info[0] != 3: 1289 | a=str(a) 1290 | 1291 | return ret, a 1292 | 1293 | def simxGetObjectGroupData(clientID, objectType, dataType, operationMode): 1294 | ''' 1295 | Please have a look at the function description/documentation in the V-REP user manual 1296 | ''' 1297 | 1298 | handles =[] 1299 | intData =[] 1300 | floatData =[] 1301 | stringData =[] 1302 | handlesC = ct.c_int() 1303 | handlesP = ct.POINTER(ct.c_int)() 1304 | intDataC = ct.c_int() 1305 | intDataP = ct.POINTER(ct.c_int)() 1306 | floatDataC = ct.c_int() 1307 | floatDataP = ct.POINTER(ct.c_float)() 1308 | stringDataC = ct.c_int() 1309 | stringDataP = ct.POINTER(ct.c_char)() 1310 | ret = c_GetObjectGroupData(clientID, objectType, dataType, ct.byref(handlesC), ct.byref(handlesP), ct.byref(intDataC), ct.byref(intDataP), ct.byref(floatDataC), ct.byref(floatDataP), ct.byref(stringDataC), ct.byref(stringDataP), operationMode) 1311 | 1312 | if ret == 0: 1313 | for i in range(handlesC.value): 1314 | handles.append(handlesP[i]) 1315 | for i in range(intDataC.value): 1316 | intData.append(intDataP[i]) 1317 | for i in range(floatDataC.value): 1318 | floatData.append(floatDataP[i]) 1319 | s = 0 1320 | for i in range(stringDataC.value): 1321 | a = bytearray() 1322 | while stringDataP[s] != b'\0': 1323 | if sys.version_info[0] == 3: 1324 | a.append(int.from_bytes(stringDataP[s],'big')) 1325 | else: 1326 | a.append(stringDataP[s]) 1327 | s += 1 1328 | s += 1 #skip null 1329 | if sys.version_info[0] == 3: 1330 | a=str(a,'utf-8') 1331 | else: 1332 | a=str(a) 1333 | stringData.append(a) 1334 | 1335 | return ret, handles, intData, floatData, stringData 1336 | 1337 | def simxCallScriptFunction(clientID, scriptDescription, options, functionName, inputInts, inputFloats, inputStrings, inputBuffer, operationMode): 1338 | ''' 1339 | Please have a look at the function description/documentation in the V-REP user manual 1340 | ''' 1341 | 1342 | inputBufferV=inputBuffer 1343 | if sys.version_info[0] == 3: 1344 | if type(scriptDescription) is str: 1345 | scriptDescription=scriptDescription.encode('utf-8') 1346 | if type(functionName) is str: 1347 | functionName=functionName.encode('utf-8') 1348 | if type(inputBuffer) is bytearray: 1349 | inputBufferV = (ct.c_ubyte*len(inputBuffer))(*inputBuffer) 1350 | if type(inputBuffer) is str: 1351 | inputBuffer=inputBuffer.encode('utf-8') 1352 | inputBufferV = (ct.c_ubyte*len(inputBuffer))(*inputBuffer) 1353 | else: 1354 | if type(inputBuffer) is bytearray: 1355 | inputBufferV = (ct.c_ubyte*len(inputBuffer))(*inputBuffer) 1356 | if type(inputBuffer) is str: 1357 | inputBuffer=bytearray(inputBuffer) 1358 | inputBufferV = (ct.c_ubyte*len(inputBuffer))(*inputBuffer) 1359 | inputBufferV=ct.cast(inputBufferV,ct.POINTER(ct.c_ubyte)) # IronPython needs this 1360 | 1361 | c_inInts = (ct.c_int*len(inputInts))(*inputInts) 1362 | c_inInts = ct.cast(c_inInts,ct.POINTER(ct.c_int)) # IronPython needs this 1363 | c_inFloats = (ct.c_float*len(inputFloats))(*inputFloats) 1364 | c_inFloats = ct.cast(c_inFloats,ct.POINTER(ct.c_float)) # IronPython needs this 1365 | 1366 | concatStr=''.encode('utf-8') 1367 | for i in range(len(inputStrings)): 1368 | a=inputStrings[i] 1369 | a=a+'\0' 1370 | if type(a) is str: 1371 | a=a.encode('utf-8') 1372 | concatStr=concatStr+a 1373 | c_inStrings = (ct.c_char*len(concatStr))(*concatStr) 1374 | 1375 | intDataOut =[] 1376 | floatDataOut =[] 1377 | stringDataOut =[] 1378 | bufferOut =bytearray() 1379 | 1380 | intDataC = ct.c_int() 1381 | intDataP = ct.POINTER(ct.c_int)() 1382 | floatDataC = ct.c_int() 1383 | floatDataP = ct.POINTER(ct.c_float)() 1384 | stringDataC = ct.c_int() 1385 | stringDataP = ct.POINTER(ct.c_char)() 1386 | bufferS = ct.c_int() 1387 | bufferP = ct.POINTER(ct.c_ubyte)() 1388 | 1389 | ret = c_CallScriptFunction(clientID,scriptDescription,options,functionName,len(inputInts),c_inInts,len(inputFloats),c_inFloats,len(inputStrings),c_inStrings,len(inputBuffer),inputBufferV,ct.byref(intDataC),ct.byref(intDataP),ct.byref(floatDataC),ct.byref(floatDataP),ct.byref(stringDataC),ct.byref(stringDataP),ct.byref(bufferS),ct.byref(bufferP),operationMode) 1390 | 1391 | if ret == 0: 1392 | for i in range(intDataC.value): 1393 | intDataOut.append(intDataP[i]) 1394 | for i in range(floatDataC.value): 1395 | floatDataOut.append(floatDataP[i]) 1396 | s = 0 1397 | for i in range(stringDataC.value): 1398 | a = bytearray() 1399 | while stringDataP[s] != b'\0': 1400 | if sys.version_info[0] == 3: 1401 | a.append(int.from_bytes(stringDataP[s],'big')) 1402 | else: 1403 | a.append(stringDataP[s]) 1404 | s += 1 1405 | s += 1 #skip null 1406 | if sys.version_info[0] == 3: 1407 | a=str(a,'utf-8') 1408 | else: 1409 | a=str(a) 1410 | stringDataOut.append(a) 1411 | for i in range(bufferS.value): 1412 | bufferOut.append(bufferP[i]) 1413 | if sys.version_info[0] != 3: 1414 | bufferOut=str(bufferOut) 1415 | 1416 | return ret, intDataOut, floatDataOut, stringDataOut, bufferOut 1417 | 1418 | def simxGetObjectVelocity(clientID, objectHandle, operationMode): 1419 | ''' 1420 | Please have a look at the function description/documentation in the V-REP user manual 1421 | ''' 1422 | linearVel = (ct.c_float*3)() 1423 | angularVel = (ct.c_float*3)() 1424 | ret = c_GetObjectVelocity(clientID, objectHandle, linearVel, angularVel, operationMode) 1425 | arr1 = [] 1426 | for i in range(3): 1427 | arr1.append(linearVel[i]) 1428 | arr2 = [] 1429 | for i in range(3): 1430 | arr2.append(angularVel[i]) 1431 | return ret, arr1, arr2 1432 | 1433 | def simxPackInts(intList): 1434 | ''' 1435 | Please have a look at the function description/documentation in the V-REP user manual 1436 | ''' 1437 | 1438 | if sys.version_info[0] == 3: 1439 | s=bytes() 1440 | for i in range(len(intList)): 1441 | s=s+struct.pack('