Learning how to sleep in a moving truck was a bit of a challenge for Diane and me when we first started, but no more so than it is for most drivers, I presume. We drove factory-sleeper trucks for three years and slept in factory sleeper beds. Some trucks rode better than others and we slept better in those.
When we custom built our own truck, it included a full-size bed with a Select Comfort Sleep Number mattress and the truck was spec'ed for a smooth ride (wheel-base, axle placement, twin screws, etc.). The ARI sleeper's highly effective blackouts were also a plus, as was the quiet ride the Volvo truck provided. These features made a surprising and profound difference in the quality of sleep we then got in a moving truck.
I know these options are not available to everyone, but whatever you can do to improve your truck's ride, the quality of your mattress and other seemingly small items that affect sleep may be worth doing.