Ego Ghost Mode
How to use Ego Ghost Mode
From the Network Settings window (access through Edit >> Network Settings), navigate to the Cmd Control tab within the Ego Network tab. A drop-down menu contains numerous options for the ego-vehicle controller - select MoraiGhostCmdController to enable Ego Ghost Mode.
Finish configuring the remaining network settings according to your development environment.
For users of ROS systems, you can check over rqt if the /ghost_ctrl_cmd topic is publishing.
Enable Auto mode for the ego-vehicle by pressing the Q key on the keyboard. If the simulator has successfully connected to a third-party using Ego Ghost Mode, the ego-vehicle should start moving around the 3D scene.
Using Ego Ghost Mode with ROS
Download the ROS message from the MORAI Github page here.
Ghost Ctrl Cmd
Ego Ghost Mode command messages move the ego-vehicle in the 3D scene irrespective of MORAI SIM’s physics models. Usually, an external source (such as connected co-simulation environments or scenario orchestrators) will move the ego-vehicle according to their data.
ROS message details:
Message Type: morai_msgs/GhostMessage
Default Topic: /ghost_ctrl_cmd
No | Name | Type | Unit | Remarks |
---|---|---|---|---|
1 | position | m | Current ego-vehicle position | |
2 | rotation | deg | Current ego-vehicle orientation | |
3 | velocity | float64 | km/h | Current ego-vehicle velocity |
4 | steering_angle | float64 | deg | Current wheel angle of the front wheels |
Using Ego Ghost Mode with UDP
Ghost Ctrl Cmd
Ghost Ctrl Cmd enables Ghost Mode for the ego-vehicle.
Protocol details
Total packet size: 32 Bytes
No | Name | Size | Type | Unit | Remarks |
---|---|---|---|---|---|
1 | x_pos_ego | 4 | float | m | Current ego-vehicle position (x-axis) |
2 | y_pos_ego | 4 | float | m | Current ego-vehicle position (y-axis) |
3 | z_pos_ego | 4 | float | m | Current ego-vehicle position (z-axis) |
4 | roll_ego | 4 | float | deg | Current roll angle of the ego-vehicle |
5 | pitch_ego | 4 | float | deg | Current pitch angle of the ego-vehicle |
6 | yaw_ego | 4 | float | deg | Current yaw angle of the ego-vehicle |
7 | speed_ego | 4 | float | km/h | Current ego-vehicle velocity |
8 | steering_ego | 4 | float | deg | Current wheel angle of the front wheels |
Some additional references
For more on connecting to MORAI SIM over UDP, refer to the MSC UDP Unit Test example code here.