Inspired by the mechanisms of idiotypic network hypothesis and ant finding food, a hybrid ant colony and immune network algorithm (AC-INA) for motion planning is presented. Taking the environment surrounding the robot and robot action as antigen and antibody respectively, an artificial immune network is constructed through the stimulation and suppression between the antigen and antibody, and the antibody network is searched using improved ant colony algorithm (ACA) with pseudo- random-proportional rule and super excellent ant colony optimization strategy. To further accelerate the convergence speed of AC-INA and realize the optimal dynamic obstacle avoidance, an improved adaptive artificial potential field (AAPF) method is provided by constructing new repulsive potential field on the basis of the relative position and velocity between the robot and obstacle. Taking the planning results of AAPF method as the prior knowledge, the initial instruction definition of new antibody is initialized through vaccine extraction and inoculation. During the motion planning, once the robot meets with moving obstacles, the AAPF method is used for the optimal dynamic obstacle avoidance. The simulation results indicate that the proposed algorithm is characterized by good convergence property, strong planning ability, self-organizing, self-learning, and optimal obstacle avoidance in dynamic environments. The experiment in known indoor environment verifies the validity of AAPF-based AC-INA, too.