I guess it is straight forward if the costmap is member, than translate the coordinate to the relevant cell (e.g. using the worldToMap function), check the costs (e.g. using the getCost function) and then compare against the cost values).