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:
[![IEEE Robotics and Automation Society](../img/logo/ras.png "IEEE Robotics and Automation Society")](http://www.ieee-ras.org) | [![Cyberbotics](../img/logo/cyberbotics.png "Cyberbotics")](http://www.cyberbotics.com) | [![The Construct](../img/logo/theconstruct.png "The Construct")](http://www.theconstructsim.com) |
Follow us:
[![Facebook](../img/logo/facebook.png "Facebook")](https://www.facebook.com/RobotProgrammingNetwork) | [![YouTube](../img/logo/youtube.png "YouTube")](https://www.youtube.com/user/robotprogrammingnet) |