Skip to content

Instantly share code, notes, and snippets.

@johnwason
Last active September 3, 2025 05:31
Show Gist options
  • Select an option

  • Save johnwason/3d398eb3ee2958d12479d3cf65ffaaa6 to your computer and use it in GitHub Desktop.

Select an option

Save johnwason/3d398eb3ee2958d12479d3cf65ffaaa6 to your computer and use it in GitHub Desktop.
Reynard the Robot demo instructions

Reynard the Robot demo instructions

Reynard the Robot is a simple cartoon robot used as an example device for learning Robot Raconteur. This demo shows the ease of connecting to a new device and controlling it using the plug-and-play features of Robot Raconteur!

See the full examples and the Getting Started Guide for more information.

Setup

The following demo files are for Python and MATLAB. Download the files before connecting to the private device access point!

Python

Download and install Python. If using Linux, install python3-pip.

Install the robotraconteur package:

python -m pip install robotraconteur

MATLAB

Install the "Robot Raconteur" add-on using the Add-on Explorer on the toolbar.

Connect to the access point

Connect to the "reynard" access point using the instructions on the sign.

Run the examples!

Run the example script. These examples use a fixed IP address to connect, but you can also use Discovery or the Service Browser to find the connection information. (Windows firewall by default will block discovery. Disable the firewall or add an exception.)

function reynard_robotraconteur_client()
% Connect to the Reynard service using a URL
c = RobotRaconteur.ConnectService('rr+tcp://10.42.0.1:29200?service=reynard');
% Enable events. Don't use if no event listeners are connected
RobotRaconteur.EnableEvents(c);
% Connect a callback function to listen for new messages
evt = addlistener(c, 'new_message', @new_message_callback);
% Read the current state using a wire "peek". Can also "connect" to receive streaming updates.
state = c.state.PeekInValue();
disp(state);
% Teleport the robot
c.teleport(0.1,-0.2);
% Drive the robot with no timeout
c.drive_robot(0.5,-0.2,-1,false);
% Wait for one second
pause(1)
% Stop the robot
c.drive_robot(0,0,-1,false);
% Set the arm position
c.setf_arm_position(deg2rad(100), deg2rad(-30), deg2rad(-70));
% Drive the arm using timeout and wait
c.drive_arm(deg2rad(10), deg2rad(-30), deg2rad(-15), 1.5, true);
% Set the color to red
c.color = [1,0,0]';
% Read the color
c_color = c.color;
disp(c_color)
pause(1);
% Reset the color
c.color = [0.929, 0.49, 0.192]';
% Say hello
c.say('Hello, World From Matlab!');
% Process events using ProcessRequests() function.
% Matlab is single threaded, so asynchronous events need to
% be executed using ProcessRequests()
for i=1:10
RobotRaconteur.ProcessRequests();
pause(0.1);
end
% Callback function for new_message
function new_message_callback(msg)
disp(['New message: ' msg]);
end
end
from RobotRaconteur.Client import *
import time
import numpy as np
# Connect to the Reynard service using a URL
c = RRN.ConnectService('rr+tcp://10.42.0.1:29200?service=reynard')
def new_message(msg):
print(f"New message: {msg}")
# Connect a callback function to listen for new messages
c.new_message += new_message
# Read the current state using a wire "peek". Can also "connect" to receive streaming updates.
state, _ = c.state.PeekInValue()
print(state)
# Teleport the robot
c.teleport(0.1, -0.2)
# Drive the robot with no timeout
c.drive_robot(0.5, -0.2, -1, False)
# Wait for one second
time.sleep(1)
# Stop the robot
c.drive_robot(0, 0, -1, False)
# Set the arm position
c.setf_arm_position(np.deg2rad(100), np.deg2rad(-30), np.deg2rad(-70))
# Drive the arm using timeout and wait
c.drive_arm(np.deg2rad(10), np.deg2rad(-30), np.deg2rad(-15), 1.5, True)
# Set the color to red
c.color = (1, 0, 0)
# Read the color
print(f"Color: {c.color}")
time.sleep(1)
# Reset the color
c.color = (0.929, 0.49, 0.192)
# Say hello
c.say("Hello, World From Robot Raconteur!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment