Creating message and converting to proto

I’m relatively new to isaac and I’m trying to figure out how I would go about creating a Odometry2 message and then converting to Odemetry2Proto from scratch (ie filling in pose speed vector etc).

I’m stuck on how I would fill in the Odometry2Proto with any data besides the reference string using:

odometryProto.setOdometryFrame("odom");

How would I go about setting the speed and acceleration vectors? Do I need to create a vector2d proto or is a 2d vector enough? When I try to manually set the values using

odometryProto.setSpeed()

it seems to ask for a proto reader as an input, but I don’t know how to create a vector2d proto or fill it in.

I looked through the proportional control tutorial example, and a message from differentialBaseControl can be created then converted to proto, I can’t seem to find an Odometry2 message that I can convert later in any of the headers.

The goal of this is to test our YdLidar X4 in gmapping on a desktop (ie no access to IMU). The odometry frame will not change and feed into the gmapping node, which we hope will start to update the map for us to test parameters.

Thanks!

Never figured out how to do what I originally intended, but it wasn’t useful anyway. An easier was to spoof was to use the state (differentialbase) message and feed that into differentialbasewheelimuodometry alongside spoofed IMU proto. Running this into gmapping allowed for maps to be made, albeit crappy ones as half the data was bad because of the spoofing. Note the drive state cannot be 0 for this to work, it required some movement, spoofing back and forth as a quick jitter was enough to generate a map.