First, I apologize if this post is in the wrong section of the forum. I am unsure if the issue is a bug in the software distribution or my code (and this is my first forum post).
A bit of backstory... I original built a scene using the current distribution of CoppeliaSim for Windows 10 (4.0.0 Edu). After completing the scene as intended I decided it would be best to connect to Qt via the bluezero interface to further the capabilities of the simulation, and given my prior experience I thought it best to continue working using Ubuntu 18.01. After installing CoppeliaSim (4.0.0 Edu) to Ubuntu 18.01 I attempt to run the exact scene (that runs as intended in Windows 10); however, on simulation start all dynamic content disappears from the scene.
After some searching, I managed to locate a snippet of code in a non-threaded child script that may be causing the issue. In the code below, I use sim.setJointTargetVelocity within sysCall_actuation as a custom way to implement vehicle acceleration during simulation. If I remove the four calls to sim.setJointTargetVelocity the dynamic content performs correctly within Ubuntu. However, with it added the dynamic content disappears. Given that no errors seem to be shown I am at a bit of a loss as to how to fix this issue.
Code: Select all
function sysCall_actuation() -- speed change-- current_time = sim.getSimulationTime() if (((current_time-original_time)>.1) and (mps_desired < new_speed)) then mps_desired = mps_desired + (speed_change / 100) original_time = current_time end -- Check the inclination of the eTrailer (this is not an angle, but for small inclinations it is ok) m=sim.getObjectMatrix(chassis,-1) inclination=m -- Retrieve the closest point to the "pathFollower" object on the path to follow: pf=sim.getObjectPosition(pathFollower,-1) m3=sim.getObjectMatrix(path,-1) ppf=sim.multiplyVector(m3,pf) -- ppf is the position of "pathFollower" relative to the path object reference frame l=sim.getClosestPositionOnPath(path,ppf) pp=sim.getPositionOnPath(path,l) -- pp is the position closest to ppf, that is on the path sim.setObjectPosition(pathFollowerTarget,-1,pp) -- set the "pathFollowerTarget" object to the pp position v=sim.getObjectPosition(pathFollowerTarget,pathFollower) -- v is the position of "pathFollowerTarget" relative to the "pathFollower" object reference frame -- Set the target position of the front wheel sim.setJointTargetPosition(turntable_rev,v) --calculation for wheel differential ratios alpha = sim.getJointPosition(turntable_rev) R = wheel_width/math.tan(alpha) ratio_inner = (R - (axle_width/2)) / R ratio_outer = (R + (axle_width/2)) / R mps_inner = mps_desired*ratio_inner mps_outer = mps_desired*ratio_outer --mps_inner = mps_desired --mps_outer = mps_desired -- calculation for etrailer wheel speed local etrailer_wheel_circumf = 0.4064*math.pi local dps_inner = (mps_inner/etrailer_wheel_circumf)*360 local dps_outer = (mps_outer/etrailer_wheel_circumf)*360 sim.setJointTargetVelocity(rear_motor_left,dps_inner*math.pi/180) sim.setJointTargetVelocity(rear_motor_right,dps_outer*math.pi/180) sim.setJointTargetVelocity(front_wheel_rev_left,dps_inner*math.pi/180) sim.setJointTargetVelocity(front_wheel_rev_right,dps_outer*math.pi/180) end
Please see the link below for access to my .ttt file (if needed):
https://drive.google.com/file/d/1G6N8-T ... sp=sharing
Also, you can view videos of a failed sim in Ubuntu as well as a successful sim in Windows at the links below:
Ubuntu- https://drive.google.com/file/d/1i9Lr9r ... sp=sharing
WIndows- https://drive.google.com/file/d/1UfEnvY ... sp=sharing
Thanks in advance!