Fundamentals of the robotics software stack.
Bryon Tjanaka | 1 September 2021
def greatest_common_divisor(x, y):
r = x % y
while r > 0:
if r == 0:
print("GCD:", y)
else:
x, y = y, r
import numpy as np # 12-line neural network.
X = np.array([ [0,0,1],[0,1,1],[1,0,1],[1,1,1] ])
y = np.array([[0,1,1,0]]).T
syn0 = 2*np.random.random((3,4)) - 1
syn1 = 2*np.random.random((4,1)) - 1
for j in xrange(60000):
l1 = 1/(1+np.exp(-(np.dot(X,syn0))))
l2 = 1/(1+np.exp(-(np.dot(l1,syn1))))
l2_delta = (y - l2)*(l2*(1-l2))
l1_delta = l2_delta.dot(syn1.T) * (l1 * (1-l1))
syn1 += l1.T.dot(l2_delta)
syn0 += X.T.dot(l1_delta)
We need to:
Camera wants to publish what it sees
Image viewer wants to subscribe to topic "images"
Camera sends images to image viewer
roscore # Start master node
rosrun turtlesim turtlesim_node # Run turtlesim
rosrun turtlesim turtle_teleop_key # Control turtlesim
rosnode list # List nodes
rostopic list # List topics
rqt_graph # View node and topic graph
rosrun rqt_plot rqt_plot # Plot turtle pose
rviz # 3D visualization; we won't
# see anything since this
# is just the turtlesim.