SpaceX has been chosen to launch a spacecraft built to deflect an asteroid that isn't headed toward Earth.

>> Read more trending news

NASA's "dirt mission" is intended to demonstrate how the agency could deflect a threat -- a technique known as a kinetic impactor.

The spacecraft is being built out of an applied physics lab at Johns Hopkins University.

The "dart mission" will be launching in June 2021 as the anticipated time frame.

Estimates for the cost of the test currently sit at $69 million.

The mission is set to launch on a Falcon 9 rocket from Vandenberg Air Force Base in California.

The mission will use an electric propulsion system to travel to the asteroid Didymos. The spacecraft would then collide with a small moon orbiting the Didymos and change the speed of the moonlet in its orbit.

The collision is projected to be able to be measured by telescopes on Earth.

Even if the asteroid's trajectory changes, it wouldn't affect the mission for NASA to demonstrate how the technology works.