#VRML_SIM R2023a utf8 # Planar Cartesian mechanism to position a spherical vision target. The Y axis # sliding joint moves laterally and the Z axis sliding joint moves vertically. # No dynamics or collision are defined. # documentation url: https://courses.ideate.cmu.edu/16-375 # license: No copyright, 2024 Garth Zeglin. This file is explicitly placed in the public domain. # template language: javascript PROTO cartesian-target [ field SFVec3f translation 0 0 0 field SFRotation rotation 0 1 0 0 field SFString controller "cartesian_target" field SFString name "cartesian_target" field SFString customData "" field SFFloat length 4.0 field SFFloat radius 0.15 ] { Robot { # connect properties to user-visible data fields translation IS translation rotation IS rotation controller IS controller name IS name customData IS customData children [ # Y axis track defined as long horizontal box Pose { # move coordinates up by half the track height translation 0 0 0.05 children [ Shape { appearance PBRAppearance { baseColor 0.70135 0.70135 1.0 roughness 0.25 metalness 0.75 } geometry Box { size 0.1 %<= fields.length.value >% 0.1 } } ] # close children of Pose } # close Pose # Y axis lateral sliding joint SliderJoint { jointParameters JointParameters { axis 0 1 0 } device [ LinearMotor { name "ymotor" controlPID 100 0 0 minPosition -2 maxPosition 2 maxForce 100 } ] endPoint Solid { # place the carriage origin at the top of the track box translation 0 0 0.1 children [ Pose { translation 0 0 0.05 children [ # sliding carriage as cube Shape { appearance PBRAppearance { baseColor 1.0 1.0 1.0 roughness 0.25 metalness 0.75 } geometry Box { size 0.1 0.1 0.1 } } ] } # Z axis vertical sliding joint SliderJoint { jointParameters JointParameters { maxStop 2 } device [ LinearMotor { name "zmotor" controlPID 100 0 0 maxPosition 2 maxForce 100 } ] endPoint Solid { # place the target origin tangent to the carriage cube translation 0 0 %<= 0.1 + fields.radius.value >% children [ # yellow sphere Shape { appearance PBRAppearance { baseColor 1 1 0 roughness 0.25 } geometry Sphere { radius %<= fields.radius.value >% } } ] } } ] } } ] } }