One of the open source robotic simulators tightly integrated with ROS is Gazebo (http://gazebosim.org). Gazebo is a dynamic robotic simulator that has a wide variety of robot models and extensive sensor support. The functionalities of Gazebo can be added via plugins. The sensor values can be accessed by ROS through topics, parameters, and services. Gazebo can be used when your simulation needs full compatibility with ROS. Most of the robotics simulators are proprietary and expensive; if you can't afford it, you can use Gazebo directly without any issues:
The preceding is a PR2 robot model from OSRF. You can find the model at https://github.com/pr2/pr2_common, in the description folder.
Now that we know about the simulators of ROS, we can begin installing ROS Melodic on Ubuntu.