# OCP Solver not being built correctly when infinity in bounds

Hi I am currently trying to build an Optimal Control Problem (OCP) in Python using `acados` and am running into a problem with the solver generation.

The OCP is used to build an MPC algorithm for an inverted pendulum system.

The code itself is implemented as follows:

``````ocp = AcadosOcp()

# set model
model = pend_model()
ocp.model = model

Tf = 1.0
nx = model.x.size()
nu = model.u.size()
N = 20

# set dimensions
ocp.dims.N = N

# set cost
Q_mat = 2 * np.diag([1e3, 1e3, 1e-2, 1e-2])
R_mat = 2 * np.diag([1e-2])

ocp.cost.cost_type = 'EXTERNAL'
ocp.cost.cost_type_e = 'EXTERNAL'
ocp.model.cost_expr_ext_cost = model.x.T @ Q_mat @ model.x + model.u.T @ R_mat @ model.u
ocp.model.cost_expr_ext_cost_e = model.x.T @ Q_mat @ model.x

# Input constraints
umax = 23
ocp.constraints.lbu = np.array([-umax])
ocp.constraints.ubu = np.array([+umax])
ocp.constraints.idxbu = np.array()

# State Constraints
xmax = [inf, inf, 0.25, inf]
xmin = [-inf, -inf, -0.25, -inf]
ocp.constraints.lbx = np.array(xmin)
ocp.constraints.ubx = np.array(xmax)
ocp.constraints.idxbx = np.array([0, 1, 2, 3])

# Initial state constraint
ocp.constraints.x0 = np.array([np.pi, 0.0, 0.0, 0.0])

# set options
ocp.solver_options.qp_solver = 'PARTIAL_CONDENSING_HPIPM'
ocp.solver_options.hessian_approx = 'EXACT'
ocp.solver_options.integrator_type = 'IRK'
ocp.solver_options.print_level = 1
ocp.solver_options.nlp_solver_type = 'SQP'

# set prediction horizon
ocp.solver_options.tf = Tf

self.ocp = ocp

``````

On further investigation, I noticed that the `AcadosOCPSolver` class did not generate a solver when I included my state constraints.

While trying to run the code this error message pops up

``````Error: Custom { kind: InvalidData, error: Error("invalid number", line: 46, column: 14) }
Traceback (most recent call last):
File "/home/s/pg22-pendulum/Real_Pendulum/OCP_Test.py", line 92, in <module>
main()
File "/home/s/pg22-pendulum/Real_Pendulum/OCP_Test.py", line 87, in main
solver = ctrl.build_ocp()
File "/home/s/pg22-pendulum/Real_Pendulum/OCP_Test.py", line 80, in build_ocp
render_template(tup, tup, output_dir, json_path)
Any help would be greatly appreciated 