Setting up cameras for visual odometry in gazebo
I am trying to use the visual odometry for stereo from the rtabmap_ros package, but the tf odom during movement in rviz does not display correctly and jumps occur from time to time. I created the stereo camera as two separate monocular cameras in gazebo and pass their topics to the visual odom node.
My question is, do I need to preset the stereo pair consisting of two regular cameras created in gazebo, since the distance between the two cameras may be different when changing the robot model in urdf?
I'm not sure I understand your question fully... But I'll take a stab and you can tell me if I've missed the mark.
Yes the baseline (distance between the two cameras) and their respective poses should be identical in both your simulation representation and your urdf representation. Ideally you would have a single urdf or xacro file that gets passed both to rviz/robot state publisher/whatever you're using, and Gazebo. That way, you change the value once and it matches.