In [ ]:
import packages.initialization
import pioneer3dx as p3dx
p3dx.init()
The code is structured in three parts:
In [ ]:
def forward():
# copy and paste your code here
...
In [ ]:
def turn():
# copy and paste your code here
...
In [ ]:
print('Pose of the robot at the start')
p3dx.pose()
for _ in range(4):
forward()
turn()
print('Pose of the robot at the end')
p3dx.pose()
The trajectory can also be displayed:
In [ ]:
%matplotlib inline
import matplotlib.pyplot as plt
x, y = p3dx.trajectory()
plt.plot(x,y)
Sponsored by:
[](http://www.ieee-ras.org) | [](http://www.cyberbotics.com) | [](http://www.theconstructsim.com) |
Follow us:
[](https://www.facebook.com/RobotProgrammingNetwork) | [](https://www.youtube.com/user/robotprogrammingnet) |