How can I send a direct movement command to carter_sim?

Hi all,

I am trying my hand at some basic movement commands. I am wanting to be able to send a message to carter_sim that says something simple like spin on the spot or move forward by giving it a linear and angular velocity. I am not looking to use the goal setting functionality with the navigation stack and all that includes. Simply move the robot with a given velocity message.

Currently though I am at a loss as to where to start. I don’t know what Proto message I can send and to what module to get it to work.

My current impression is that I would send a StateProto to “base_simulation/isaac.flatsim.DifferentialBaseSimulator/diff_base_command” and that would translate the velocity messages into movement.

However, I am not sure about this and don’t know how I would correctly create a StateProto if I am correct.

Can I receive some guidance here please?

If you check out the proportional control tutorials in isaac/apps/tutorials, there is an example of how to build and publish a StateProto (linear speed is its “forward” travel rate while angular speed is the turn rate):


// Publish control command
  messages::DifferentialBaseControl command;
  command.linear_speed() = control;
  command.angular_speed() = 0.0;  // This simple example sets zero angular speed
  ToProto(command, tx_cmd().initProto());

# Publish control command
  tx_message = self.tx.init_proto()
  data = tx_message.init('data', 2)
  data[0] = control  # linear speed
  data[1] = 0.0  # This simple example sets zero angular speed

You will also need to set up the output connections, variables, etc. as done in the tutorials, but that’s the meat of transmitting a StateProto with linear and angular velocity.

See for more info on the prototype

Excellent! Just the pointer I needed to get me started.