I created a bundle product and when I try to get that Bundle product id on product detail page I am getting simple product id of that bundle product instead of Bundle product id. I used this function to get bundle id but its giving all the parent bundle products id instead of current bundle product id :
$model = \Magento\Framework\App\ObjectManager::getInstance()->get('\Magento\Bundle\Model\Product\Type');
$product = $this->product;
$parentIds = $model->getParentIdsByChild($product->getId());