URDF joints are moving unexpectedly

I am trying to create a urdf model of a wheeled robot using meshes from a solidworks file.

I am encountering an issue where the joints in my model are behaving unexpectedly. I have defined the back wheels as continuous joints that can rotate around the x axis. The rotation behaves correctly, but the joint is moving in the y-z plane. In the images below you can see the model is rendered correctly in r-viz, however in gazebo, the joints are not position correctly and will actually move around. I am wondering what might be causing this issue. I did use http://wiki.ros.org/sw_urdf_exporter to create this urdf.

I am wondering what might be causing this issue. I have tried out several things, like adjusting values in urdf with no avail.

It’s hard to say from what you provided. In a physics simulation like Gazebo, there can be issues with self collision. Perhaps that wheel is colliding with the robot and the forces try to push it out.