Skip to content

Commit

Permalink
examples properly import plotter
Browse files Browse the repository at this point in the history
  • Loading branch information
pantor committed Oct 9, 2023
1 parent a41ce34 commit a6b0444
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 8 deletions.
7 changes: 6 additions & 1 deletion examples/01_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
print(f'Trajectory duration: {first_output.trajectory.duration:0.4f} [s]')

# Plot the trajectory
# from pathlib import Path
# import sys
# project_path = Path(__file__).parent.parent.absolute()
# sys.path.append(str(project_path / 'test')) # For plotter.py

# from plotter import Plotter

# Plotter.plot_trajectory(Path(__file__).parent.absolute() / '1_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
# Plotter.plot_trajectory(project_path / 'examples' / '01_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
7 changes: 6 additions & 1 deletion examples/03_waypoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
print(f'Trajectory duration: {first_output.trajectory.duration:0.4f} [s]')

# Plot the trajectory
# from pathlib import Path
# import sys
# project_path = Path(__file__).parent.parent.absolute()
# sys.path.append(str(project_path / 'test')) # For plotter.py

# from plotter import Plotter

# Plotter.plot_trajectory(Path(__file__).parent.absolute() / '3_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
# Plotter.plot_trajectory(project_path / 'examples' / '03_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
7 changes: 6 additions & 1 deletion examples/04_waypoints_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@
out.pass_to_input(inp)

# Plot the trajectory
# from pathlib import Path
# import sys
# project_path = Path(__file__).parent.parent.absolute()
# sys.path.append(str(project_path / 'test')) # For plotter.py

# from plotter import Plotter

# Plotter.plot_trajectory(Path(__file__).parent.absolute() / '4_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
# Plotter.plot_trajectory(project_path / 'examples' / '04_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
7 changes: 6 additions & 1 deletion examples/05_velocity.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
print(f'Trajectory duration: {first_output.trajectory.duration:0.4f} [s]')

# Plot the trajectory
# from pathlib import Path
# import sys
# project_path = Path(__file__).parent.parent.absolute()
# sys.path.append(str(project_path / 'test')) # For plotter.py

# from plotter import Plotter

# Plotter.plot_trajectory(Path(__file__).parent.absolute() / '5_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
# Plotter.plot_trajectory(project_path / 'examples' / '05_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
7 changes: 6 additions & 1 deletion examples/06_stop.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
print(f'Trajectory duration: {first_output.trajectory.duration:0.4f} [s]')

# Plot the trajectory
# from pathlib import Path
# import sys
# project_path = Path(__file__).parent.parent.absolute()
# sys.path.append(str(project_path / 'test')) # For plotter.py

# from plotter import Plotter

# Plotter.plot_trajectory(Path(__file__).parent.absolute() / '6_trajectory.pdf', otg, inp, out_list, plot_jerk=False, time_offsets=time_offsets)
# Plotter.plot_trajectory(project_path / 'examples' / '06_trajectory.pdf', otg, inp, out_list, plot_jerk=False, time_offsets=time_offsets)
7 changes: 6 additions & 1 deletion examples/07_minimum_duration.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
print(f'Trajectory duration: {first_output.trajectory.duration:0.4f} [s]')

# Plot the trajectory
# from pathlib import Path
# import sys
# project_path = Path(__file__).parent.parent.absolute()
# sys.path.append(str(project_path / 'test')) # For plotter.py

# from plotter import Plotter

# Plotter.plot_trajectory(Path(__file__).parent.absolute() / '7_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
# Plotter.plot_trajectory(project_path / 'examples' / '07_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
7 changes: 6 additions & 1 deletion examples/08_per_section_minimum_duration.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@
print(f'Trajectory duration: {first_output.trajectory.duration:0.4f} [s]')

# Plot the trajectory
# from pathlib import Path
# import sys
# project_path = Path(__file__).parent.parent.absolute()
# sys.path.append(str(project_path / 'test')) # For plotter.py

# from plotter import Plotter

# Plotter.plot_trajectory(Path(__file__).parent.absolute() / '8_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
# Plotter.plot_trajectory(project_path / 'examples' / '08_trajectory.pdf', otg, inp, out_list, plot_jerk=False)
5 changes: 4 additions & 1 deletion examples/14_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ def model_sinus(t, ramp_vel=0.4):


# Plot the trajectory
# from pathlib import Path
# project_path = Path(__file__).parent.parent.absolute()

# import numpy as np
# import matplotlib.pyplot as plt

Expand All @@ -80,4 +83,4 @@ def model_sinus(t, ramp_vel=0.4):
# plt.grid(True)
# plt.legend()

# plt.savefig(Path(__file__).parent.absolute() / '13_trajectory.pdf')
# plt.savefig(project_path / 'examples' / '13_trajectory.pdf')

0 comments on commit a6b0444

Please sign in to comment.