Ultrasonic sensors with 12v motors will not work! (ADRUINO)
TLDR: change your project (both program and connection) to use ultrasound sensor on any two of pins 3,5,11 and it should work.



You are using pins 7 and 8 for ultrasound.

At the same time you are using the shield  https://www.pololu.com/product/2507 for motors, but if you look at the shield description on picture Dual VNH5019 motor driver shield with an Arduino (shield and Arduino powered separately).https://a.pololu-files.com/picture/0J3753.1200.png?5877a2053bf73d6dbb43d10e7d268ce5 
You will see, that the shield is using pin 7 as M2INA and pin 8 as M2PINB

So each loop you push M2INA (trigPin) LOW, then HIGH then LOW, then wait until the sensor write HIGH to M2INB (echoPin) just to immediately send PWM pulses to both trigPin (M2INA) and echoPin (M2INB) via commands 

    md.setM1Speed(100);  
    md.setM2Speed(-100); 


No way it can work as you expect.

You must use other pins (unused by the shield) for your ultrasound sensor. I suggest to declare 

#define trigPin 3
#define echoPin 5


and connect your ultrasound sensor there acordingly.

(You can use also pin 11 if you want. I would not recomend pin 13, as there is connected the Arduino LED, which is used by bootloader too so you could confuse the sensor, nor the pins 1 and 2, as they are used by Serial (and USB). Also you can use the "analog pins" A2..A5 as digital pins, but it may confuse you a little (AVR can use "analog" pins as "digital" but many beginers does not like constructs as "digitalWrite(A2)", "digitalRead(A3)").

Also keep in mind, that A4 and A5 are used for I2C communication, if you would use I2C later in project.