From af854d6d1ac604cc3c86e1b4991d2f9c84f74b5d Mon Sep 17 00:00:00 2001 From: Atsushi Sakai Date: Sun, 3 Feb 2019 10:20:23 +0900 Subject: [PATCH] add # pragma: no cover --- .../rocket_powered_landing.py | 2 +- Mapping/circle_fitting/circle_fitting.py | 2 +- .../gaussian_grid_map/gaussian_grid_map.py | 2 +- .../kmeans_clustering/kmeans_clustering.py | 2 +- .../raycasting_grid_map.py | 3 ++- PathPlanning/AStar/a_star.py | 6 +++--- .../eta3_spline_trajectory.py | 2 +- .../frenet_optimal_trajectory.py | 4 ++-- PathPlanning/LQRRRTStar/lqr_rrt_star.py | 2 +- .../model_predictive_trajectory_generator.py | 2 +- .../reeds_shepp_path_planning.py | 4 ++-- .../VoronoiRoadMap/voronoi_road_map.py | 8 ++++---- PathTracking/cgmres_nmpc/cgmres_nmpc.py | 2 +- .../lqr_speed_steer_control.py | 16 +++++++-------- .../lqr_steer_control/lqr_steer_control.py | 2 +- ...odel_predictive_speed_and_steer_control.py | 6 +++--- PathTracking/move_to_pose/move_to_pose.py | 2 +- PathTracking/pure_pursuit/pure_pursuit.py | 4 ++-- .../rear_wheel_feedback.py | 9 ++++----- .../stanley_controller/stanley_controller.py | 4 ++-- SLAM/EKFSLAM/ekf_slam.py | 20 +++++++++---------- SLAM/FastSLAM1/fast_slam1.py | 2 +- SLAM/FastSLAM2/fast_slam2.py | 2 +- SLAM/GraphBasedSLAM/graph_based_slam.py | 3 +-- .../iterative_closest_point.py | 2 +- 25 files changed, 55 insertions(+), 58 deletions(-) diff --git a/AerialNavigation/rocket_powered_landing/rocket_powered_landing.py b/AerialNavigation/rocket_powered_landing/rocket_powered_landing.py index 2a07cb98..9f1e16fc 100644 --- a/AerialNavigation/rocket_powered_landing/rocket_powered_landing.py +++ b/AerialNavigation/rocket_powered_landing/rocket_powered_landing.py @@ -656,7 +656,7 @@ def main(): print(f'Converged after {it + 1} iterations.') break - if show_animation: + if show_animation: # pragma: no cover plot_animation(X, U) print("done!!") diff --git a/Mapping/circle_fitting/circle_fitting.py b/Mapping/circle_fitting/circle_fitting.py index b3de66e4..dae9413d 100644 --- a/Mapping/circle_fitting/circle_fitting.py +++ b/Mapping/circle_fitting/circle_fitting.py @@ -122,7 +122,7 @@ def main(): ex, ey, er, error = circle_fitting(x, y) print("Error:", error) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.axis("equal") plt.plot(0.0, 0.0, "*r") diff --git a/Mapping/gaussian_grid_map/gaussian_grid_map.py b/Mapping/gaussian_grid_map/gaussian_grid_map.py index 3e9d0ece..b520b639 100644 --- a/Mapping/gaussian_grid_map/gaussian_grid_map.py +++ b/Mapping/gaussian_grid_map/gaussian_grid_map.py @@ -71,7 +71,7 @@ def main(): gmap, minx, maxx, miny, maxy = generate_gaussian_grid_map( ox, oy, xyreso, STD) - if show_animation: + if show_animation: # pragma: no cover plt.cla() draw_heatmap(gmap, minx, maxx, miny, maxy, xyreso) plt.plot(ox, oy, "xr") diff --git a/Mapping/kmeans_clustering/kmeans_clustering.py b/Mapping/kmeans_clustering/kmeans_clustering.py index 9d333451..984b5565 100644 --- a/Mapping/kmeans_clustering/kmeans_clustering.py +++ b/Mapping/kmeans_clustering/kmeans_clustering.py @@ -161,7 +161,7 @@ def main(): clusters = kmeans_clustering(rx, ry, ncluster) # for animation - if show_animation: + if show_animation: # pragma: no cover plt.cla() inds = calc_association(cx, cy, clusters) for ic in inds: diff --git a/Mapping/raycasting_grid_map/raycasting_grid_map.py b/Mapping/raycasting_grid_map/raycasting_grid_map.py index 7790685c..99768742 100644 --- a/Mapping/raycasting_grid_map/raycasting_grid_map.py +++ b/Mapping/raycasting_grid_map/raycasting_grid_map.py @@ -121,7 +121,8 @@ def main(): oy = (np.random.rand(4) - 0.5) * 10.0 pmap, minx, maxx, miny, maxy, xyreso = generate_ray_casting_grid_map( ox, oy, xyreso, yawreso) - if show_animation: + + if show_animation: # pragma: no cover plt.cla() draw_heatmap(pmap, minx, maxx, miny, maxy, xyreso) plt.plot(ox, oy, "xr") diff --git a/PathPlanning/AStar/a_star.py b/PathPlanning/AStar/a_star.py index a1e36aaf..65dfe88f 100644 --- a/PathPlanning/AStar/a_star.py +++ b/PathPlanning/AStar/a_star.py @@ -68,7 +68,7 @@ def a_star_planning(sx, sy, gx, gy, ox, oy, reso, rr): current = openset[c_id] # show graph - if show_animation: + if show_animation: # pragma: no cover plt.plot(current.x * reso, current.y * reso, "xc") if len(closedset.keys()) % 10 == 0: plt.pause(0.001) @@ -214,7 +214,7 @@ def main(): ox.append(40.0) oy.append(60.0 - i) - if show_animation: + if show_animation: # pragma: no cover plt.plot(ox, oy, ".k") plt.plot(sx, sy, "xr") plt.plot(gx, gy, "xb") @@ -223,7 +223,7 @@ def main(): rx, ry = a_star_planning(sx, sy, gx, gy, ox, oy, grid_size, robot_size) - if show_animation: + if show_animation: # pragma: no cover plt.plot(rx, ry, "-r") plt.show() diff --git a/PathPlanning/Eta3SplineTrajectory/eta3_spline_trajectory.py b/PathPlanning/Eta3SplineTrajectory/eta3_spline_trajectory.py index af9d777c..22928354 100644 --- a/PathPlanning/Eta3SplineTrajectory/eta3_spline_trajectory.py +++ b/PathPlanning/Eta3SplineTrajectory/eta3_spline_trajectory.py @@ -313,7 +313,7 @@ def test1(max_vel=0.5): for j, t in enumerate(times): state[:, j] = traj.calc_traj_point(t) - if show_animation: + if show_animation: # pragma: no cover # plot the path plt.plot(state[0, :], state[1, :]) plt.pause(1.0) diff --git a/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py b/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py index 2f31f0c6..e0a338f2 100644 --- a/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py +++ b/PathPlanning/FrenetOptimalTrajectory/frenet_optimal_trajectory.py @@ -343,7 +343,7 @@ def main(): print("Goal") break - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(tx, ty) plt.plot(ob[:, 0], ob[:, 1], "xk") @@ -356,7 +356,7 @@ def main(): plt.pause(0.0001) print("Finish") - if show_animation: + if show_animation: # pragma: no cover plt.grid(True) plt.pause(0.0001) plt.show() diff --git a/PathPlanning/LQRRRTStar/lqr_rrt_star.py b/PathPlanning/LQRRRTStar/lqr_rrt_star.py index 489fdfbf..c34f0b12 100644 --- a/PathPlanning/LQRRRTStar/lqr_rrt_star.py +++ b/PathPlanning/LQRRRTStar/lqr_rrt_star.py @@ -304,7 +304,7 @@ def main(): path = rrt.planning(animation=show_animation) # Draw final path - if show_animation: + if show_animation: # pragma: no cover rrt.draw_graph() plt.plot([x for (x, y) in path], [y for (x, y) in path], '-r') plt.grid(True) diff --git a/PathPlanning/ModelPredictiveTrajectoryGenerator/model_predictive_trajectory_generator.py b/PathPlanning/ModelPredictiveTrajectoryGenerator/model_predictive_trajectory_generator.py index 5dad3c0b..1da57812 100644 --- a/PathPlanning/ModelPredictiveTrajectoryGenerator/model_predictive_trajectory_generator.py +++ b/PathPlanning/ModelPredictiveTrajectoryGenerator/model_predictive_trajectory_generator.py @@ -123,7 +123,7 @@ def optimize_trajectory(target, k0, p): p += alpha * np.array(dp) # print(p.T) - if show_animation: + if show_animation: # pragma: no cover show_trajectory(target, xc, yc) else: xc, yc, yawc, p = None, None, None, None diff --git a/PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py b/PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py index 6049f793..da1b4f34 100644 --- a/PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py +++ b/PathPlanning/ReedsSheppPath/reeds_shepp_path_planning.py @@ -393,7 +393,7 @@ def test(): px, py, pyaw, mode, clen = reeds_shepp_path_planning( start_x, start_y, start_yaw, end_x, end_y, end_yaw, curvature, step_size) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(px, py, label="final course " + str(mode)) @@ -430,7 +430,7 @@ def main(): px, py, pyaw, mode, clen = reeds_shepp_path_planning( start_x, start_y, start_yaw, end_x, end_y, end_yaw, curvature, step_size) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(px, py, label="final course " + str(mode)) diff --git a/PathPlanning/VoronoiRoadMap/voronoi_road_map.py b/PathPlanning/VoronoiRoadMap/voronoi_road_map.py index 1e18d21c..3ac02993 100644 --- a/PathPlanning/VoronoiRoadMap/voronoi_road_map.py +++ b/PathPlanning/VoronoiRoadMap/voronoi_road_map.py @@ -78,7 +78,7 @@ def VRM_planning(sx, sy, gx, gy, ox, oy, rr): obkdtree = KDTree(np.vstack((ox, oy)).T) sample_x, sample_y = sample_points(sx, sy, gx, gy, rr, ox, oy, obkdtree) - if show_animation: + if show_animation: # pragma: no cover plt.plot(sample_x, sample_y, ".b") road_map = generate_roadmap(sample_x, sample_y, rr, obkdtree) @@ -183,7 +183,7 @@ def dijkstra_planning(sx, sy, gx, gy, ox, oy, rr, road_map, sample_x, sample_y): current = openset[c_id] # show graph - if show_animation and len(closedset.keys()) % 2 == 0: + if show_animation and len(closedset.keys()) % 2 == 0: # pragma: no cover plt.plot(current.x, current.y, "xg") plt.pause(0.001) @@ -287,7 +287,7 @@ def main(): ox.append(40.0) oy.append(60.0 - i) - if show_animation: + if show_animation: # pragma: no cover plt.plot(ox, oy, ".k") plt.plot(sx, sy, "^r") plt.plot(gx, gy, "^c") @@ -298,7 +298,7 @@ def main(): assert rx, 'Cannot found path' - if show_animation: + if show_animation: # pragma: no cover plt.plot(rx, ry, "-r") plt.show() diff --git a/PathTracking/cgmres_nmpc/cgmres_nmpc.py b/PathTracking/cgmres_nmpc/cgmres_nmpc.py index 164c6895..74a0f9cc 100644 --- a/PathTracking/cgmres_nmpc/cgmres_nmpc.py +++ b/PathTracking/cgmres_nmpc/cgmres_nmpc.py @@ -584,7 +584,7 @@ def main(): # update state plant_system.update_state(u_1s[0], u_2s[0]) - if show_animation: + if show_animation: # pragma: no cover animation(plant_system, controller, dt) plot_figures(plant_system, controller, iteration_num, dt) diff --git a/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py b/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py index 4e4dacf0..a39cfba9 100644 --- a/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py +++ b/PathTracking/lqr_speed_steer_control/lqr_speed_steer_control.py @@ -1,3 +1,8 @@ +import cubic_spline_planner +import scipy.linalg as la +import matplotlib.pyplot as plt +import math +import numpy as np """ Path tracking simulation with LQR speed and steering control @@ -8,11 +13,6 @@ author Atsushi Sakai (@Atsushi_twi) import sys sys.path.append("../../PathPlanning/CubicSpline/") -import numpy as np -import math -import matplotlib.pyplot as plt -import scipy.linalg as la -import cubic_spline_planner # LQR parameter Q = np.eye(5) @@ -206,8 +206,8 @@ def closed_loop_prediction(cx, cy, cyaw, ck, speed_profile, goal): plt.plot(cx[target_ind], cy[target_ind], "xg", label="target") plt.axis("equal") plt.grid(True) - plt.title("speed[km/h]:" + str(round(state.v * 3.6, 2)) + - ",target index:" + str(target_ind)) + plt.title("speed[km/h]:" + str(round(state.v * 3.6, 2)) + + ",target index:" + str(target_ind)) plt.pause(0.0001) return t, x, y, yaw, v @@ -257,7 +257,7 @@ def main(): t, x, y, yaw, v = closed_loop_prediction(cx, cy, cyaw, ck, sp, goal) - if show_animation: + if show_animation: # pragma: no cover plt.close() plt.subplots(1) plt.plot(ax, ay, "xb", label="waypoints") diff --git a/PathTracking/lqr_steer_control/lqr_steer_control.py b/PathTracking/lqr_steer_control/lqr_steer_control.py index 188cdf08..f977cdc2 100644 --- a/PathTracking/lqr_steer_control/lqr_steer_control.py +++ b/PathTracking/lqr_steer_control/lqr_steer_control.py @@ -255,7 +255,7 @@ def main(): t, x, y, yaw, v = closed_loop_prediction(cx, cy, cyaw, ck, sp, goal) - if show_animation: + if show_animation: # pragma: no cover plt.close() plt.subplots(1) plt.plot(ax, ay, "xb", label="input") diff --git a/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py b/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py index a6c7d7bc..96a6387e 100644 --- a/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py +++ b/PathTracking/model_predictive_speed_and_steer_control/model_predictive_speed_and_steer_control.py @@ -427,7 +427,7 @@ def do_simulation(cx, cy, cyaw, ck, sp, dl, initial_state): print("Goal") break - if show_animation: + if show_animation: # pragma: no cover plt.cla() if ox is not None: plt.plot(ox, oy, "xr", label="MPC") @@ -563,7 +563,7 @@ def main(): t, x, y, yaw, v, d, a = do_simulation( cx, cy, cyaw, ck, sp, dl, initial_state) - if show_animation: + if show_animation: # pragma: no cover plt.close("all") plt.subplots() plt.plot(cx, cy, "-r", label="spline") @@ -596,7 +596,7 @@ def main2(): t, x, y, yaw, v, d, a = do_simulation( cx, cy, cyaw, ck, sp, dl, initial_state) - if show_animation: + if show_animation: # pragma: no cover plt.close("all") plt.subplots() plt.plot(cx, cy, "-r", label="spline") diff --git a/PathTracking/move_to_pose/move_to_pose.py b/PathTracking/move_to_pose/move_to_pose.py index c03ef21b..0814ef62 100644 --- a/PathTracking/move_to_pose/move_to_pose.py +++ b/PathTracking/move_to_pose/move_to_pose.py @@ -67,7 +67,7 @@ def move_to_pose(x_start, y_start, theta_start, x_goal, y_goal, theta_goal): x = x + v * np.cos(theta) * dt y = y + v * np.sin(theta) * dt - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.arrow(x_start, y_start, np.cos(theta_start), np.sin(theta_start), color='r', width=0.1) diff --git a/PathTracking/pure_pursuit/pure_pursuit.py b/PathTracking/pure_pursuit/pure_pursuit.py index b407e6f2..34ec527b 100644 --- a/PathTracking/pure_pursuit/pure_pursuit.py +++ b/PathTracking/pure_pursuit/pure_pursuit.py @@ -126,7 +126,7 @@ def main(): v.append(state.v) t.append(time) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(cx, cy, ".r", label="course") plt.plot(x, y, "-b", label="trajectory") @@ -139,7 +139,7 @@ def main(): # Test assert lastIndex >= target_ind, "Cannot goal" - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(cx, cy, ".r", label="course") plt.plot(x, y, "-b", label="trajectory") diff --git a/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py b/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py index 9d6e3302..ee677d3d 100644 --- a/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py +++ b/PathTracking/rear_wheel_feedback/rear_wheel_feedback.py @@ -1,3 +1,6 @@ +import cubic_spline_planner +import matplotlib.pyplot as plt +import math """ Path tracking simulation with rear wheel feedback steering control and PID speed control. @@ -8,10 +11,6 @@ author: Atsushi Sakai(@Atsushi_twi) import sys sys.path.append("../../PathPlanning/CubicSpline/") -import math -import matplotlib.pyplot as plt -import cubic_spline_planner - Kp = 1.0 # speed propotional gain # steering control parameter @@ -202,7 +201,7 @@ def main(): # Test assert goal_flag, "Cannot goal" - if show_animation: + if show_animation: # pragma: no cover plt.close() plt.subplots(1) plt.plot(ax, ay, "xb", label="input") diff --git a/PathTracking/stanley_controller/stanley_controller.py b/PathTracking/stanley_controller/stanley_controller.py index 11d4bfee..addd5ad3 100644 --- a/PathTracking/stanley_controller/stanley_controller.py +++ b/PathTracking/stanley_controller/stanley_controller.py @@ -184,7 +184,7 @@ def main(): v.append(state.v) t.append(time) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(cx, cy, ".r", label="course") plt.plot(x, y, "-b", label="trajectory") @@ -197,7 +197,7 @@ def main(): # Test assert last_idx >= target_idx, "Cannot reach goal" - if show_animation: + if show_animation: # pragma: no cover plt.plot(cx, cy, ".r", label="course") plt.plot(x, y, "-b", label="trajectory") plt.legend() diff --git a/SLAM/EKFSLAM/ekf_slam.py b/SLAM/EKFSLAM/ekf_slam.py index 8f1d9976..f2c001d2 100644 --- a/SLAM/EKFSLAM/ekf_slam.py +++ b/SLAM/EKFSLAM/ekf_slam.py @@ -97,12 +97,12 @@ def observation(xTrue, xd, u, RFID): def motion_model(x, u): F = np.array([[1.0, 0, 0], - [0, 1.0, 0], - [0, 0, 1.0]]) + [0, 1.0, 0], + [0, 0, 1.0]]) B = np.array([[DT * math.cos(x[2, 0]), 0], - [DT * math.sin(x[2, 0]), 0], - [0.0, DT]]) + [DT * math.sin(x[2, 0]), 0], + [0.0, DT]]) x = (F @ x) + (B @ u) return x @@ -119,8 +119,8 @@ def jacob_motion(x, u): (STATE_SIZE, LM_SIZE * calc_n_LM(x))))) jF = np.array([[0.0, 0.0, -DT * u[0] * math.sin(x[2, 0])], - [0.0, 0.0, DT * u[0] * math.cos(x[2, 0])], - [0.0, 0.0, 0.0]]) + [0.0, 0.0, DT * u[0] * math.cos(x[2, 0])], + [0.0, 0.0, 0.0]]) G = np.eye(STATE_SIZE) + Fx.T * jF * Fx @@ -170,7 +170,7 @@ def calc_innovation(lm, xEst, PEst, z, LMid): delta = lm - xEst[0:2] q = (delta.T @ delta)[0, 0] #zangle = math.atan2(delta[1], delta[0]) - xEst[2] - zangle = math.atan2(delta[1,0], delta[0,0]) - xEst[2] + zangle = math.atan2(delta[1, 0], delta[0, 0]) - xEst[2] zp = np.array([[math.sqrt(q), pi_2_pi(zangle)]]) y = (z - zp).T y[1] = pi_2_pi(y[1]) @@ -183,7 +183,7 @@ def calc_innovation(lm, xEst, PEst, z, LMid): def jacobH(q, delta, x, i): sq = math.sqrt(q) G = np.array([[-sq * delta[0, 0], - sq * delta[1, 0], 0, sq * delta[0, 0], sq * delta[1, 0]], - [delta[1, 0], - delta[0, 0], - 1.0, - delta[1, 0], delta[0, 0]]]) + [delta[1, 0], - delta[0, 0], - 1.0, - delta[1, 0], delta[0, 0]]]) G = G / q nLM = calc_n_LM(x) @@ -235,13 +235,12 @@ def main(): x_state = xEst[0:STATE_SIZE] - # store data history hxEst = np.hstack((hxEst, x_state)) hxDR = np.hstack((hxDR, xDR)) hxTrue = np.hstack((hxTrue, xTrue)) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(RFID[:, 0], RFID[:, 1], "*k") @@ -263,6 +262,5 @@ def main(): plt.pause(0.001) - if __name__ == '__main__': main() \ No newline at end of file diff --git a/SLAM/FastSLAM1/fast_slam1.py b/SLAM/FastSLAM1/fast_slam1.py index 08f4db6a..757e9f95 100644 --- a/SLAM/FastSLAM1/fast_slam1.py +++ b/SLAM/FastSLAM1/fast_slam1.py @@ -373,7 +373,7 @@ def main(): hxDR = np.hstack((hxDR, xDR)) hxTrue = np.hstack((hxTrue, xTrue)) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(RFID[:, 0], RFID[:, 1], "*k") diff --git a/SLAM/FastSLAM2/fast_slam2.py b/SLAM/FastSLAM2/fast_slam2.py index 2fcde3d9..3d73a58e 100644 --- a/SLAM/FastSLAM2/fast_slam2.py +++ b/SLAM/FastSLAM2/fast_slam2.py @@ -402,7 +402,7 @@ def main(): hxDR = np.hstack((hxDR, xDR)) hxTrue = np.hstack((hxTrue, xTrue)) - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(RFID[:, 0], RFID[:, 1], "*k") diff --git a/SLAM/GraphBasedSLAM/graph_based_slam.py b/SLAM/GraphBasedSLAM/graph_based_slam.py index 6cb28542..b40ad649 100644 --- a/SLAM/GraphBasedSLAM/graph_based_slam.py +++ b/SLAM/GraphBasedSLAM/graph_based_slam.py @@ -295,14 +295,13 @@ def main(): xTrue, z, xDR, ud = observation(xTrue, xDR, u, RFID) - hz.append(z) if dtime >= show_graph_dtime: x_opt = graph_based_slam(hxDR, hz) dtime = 0.0 - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(RFID[:, 0], RFID[:, 1], "*k") diff --git a/SLAM/iterative_closest_point/iterative_closest_point.py b/SLAM/iterative_closest_point/iterative_closest_point.py index a1412f4a..da8ffeac 100644 --- a/SLAM/iterative_closest_point/iterative_closest_point.py +++ b/SLAM/iterative_closest_point/iterative_closest_point.py @@ -33,7 +33,7 @@ def ICP_matching(ppoints, cpoints): while dError >= EPS: count += 1 - if show_animation: + if show_animation: # pragma: no cover plt.cla() plt.plot(ppoints[0, :], ppoints[1, :], ".r") plt.plot(cpoints[0, :], cpoints[1, :], ".b")