If you want to use other msgs beside default rtps msgs for ROS2, add them to urtps_bridge_topics.yaml, in:
cd px4_ros2_sim/PX4-Autopilot/msg/tools
python3 uorb_to_ros_urtps_topics.py -i urtps_bridge_topics.yaml -o ../../../px4_ros_com_ros2/src/px4_ros_com/templates/urtps_bridge_topics.yaml
cd ../..
make clean
Then fallow the instructions below
To run the simulation and a sample mission, run the following parts.
# In a new termianl
# Starting in the root of repo
cd ~/px4_ros2_sim/PX4-Autopilot/
make px4_sitl_rtps gazebo
# In a new termianl
cd px4_ros2_sim/px4_ros_com_ros2/ #Or Where ever the file is and then cd
source install/setup.bash
micrortps_agent -t UDP
# In a new termianl
cd px4_ros2_sim/px4_ros_com_ros2/ #Or Where ever the file is and then cd
source install/setup.bash
#For Vel CMD
ros2 run px4_missions offBoardRTPS_Vel
#For Vel Pose
ros2 run px4_missions offBoardRTPS_Pose