Back to Case Studies
NiryoNiryo

Niryo Robotics: A Deep Dive into their Blockly & Python Integration

M

Michael Rodriguez

Technical Writer · August 1, 2025

#robotics#case-study#python#education
Niryo Robotics: A Deep Dive into their Blockly & Python Integration

Niryo Robotics: A Deep Dive into their Blockly & Python Integration

Company Background

Niryo is a French robotics company specializing in collaborative 6-axis robotic arms for education, research, and small businesses. Founded in 2016, they've become a leading provider of accessible robotics solutions that bridge the gap between industrial-grade hardware and intuitive programming interfaces.

The Challenge: Accessible Robot Programming

When Niryo developed their first robotic arm, the Niryo One, they faced a significant challenge: how to make complex robotics accessible to non-programmers while still providing the power and flexibility that advanced users need.

"We wanted students as young as 12 to be able to program complex robotic movements, while also allowing university researchers to access all the low-level functionality." — Edouard Renard, CTO at Niryo

Why Blockly?

After evaluating several options, Niryo chose Blockly as their visual programming solution for several reasons:

  1. Familiar visual paradigm: Many educational users were already familiar with block-based programming from platforms like Scratch
  2. Seamless code generation: Blockly's ability to generate Python code aligned perfectly with their technical architecture
  3. Customization capabilities: The team needed to create domain-specific blocks for robotics commands
  4. Open source foundation: As an open-source project themselves, Niryo values building on open technologies

Implementation Details

Custom Block Design

Niryo created several custom block categories tailored specifically for robotics:

Blockly.defineBlocksWithJsonArray([
  {
    "type": "niryo_move_joints",
    "message0": "Move joints to %1 %2 %3 %4 %5 %6 %7",
    "args0": [
      {
        "type": "field_number",
        "name": "JOINT_1",
        "value": 0,
        "min": -175,
        "max": 175
      },
      // Additional joint configurations...
    ],
    "previousStatement": null,
    "nextStatement": null,
    "colour": 230,
    "tooltip": "Move robot joints to specific angles (in degrees)"
  },
  // Additional blocks...
]);

Python Code Generation

One of the most elegant aspects of Niryo's implementation is how they generate Python code from Blockly blocks, which is then executed directly on their robot controller:

Blockly.Python['niryo_move_joints'] = function(block) {
  const joint1 = block.getFieldValue('JOINT_1');
  const joint2 = block.getFieldValue('JOINT_2');
  // Additional joints...
  
  const code = `robot.move_joints(${joint1}, ${joint2}, ${joint3}, ${joint4}, ${joint5}, ${joint6})\n`;
  return code;
};

Architecture Overview

The Niryo Studio application architecture consists of several layers:

  1. User Interface Layer: Browser-based Blockly editor
  2. Translation Layer: Converts Blockly to Python code
  3. Execution Layer: Sends Python commands to the robot via API
  4. Robot Control Layer: Low-level firmware executing movement commands

Results and Impact

Since implementing Blockly in 2018, Niryo has seen remarkable results:

  • 92% increase in educational adoption of their robotic arms
  • Reduced support tickets related to programming issues by 78%
  • Expanded user base to include middle schools and non-technical businesses
  • Higher engagement with an average programming session increasing from 18 to 47 minutes

Lessons Learned

The Niryo team shared several valuable insights from their Blockly implementation:

  1. Block Granularity: Finding the right level of abstraction for blocks was crucial. Too fine-grained and programs become unwieldy; too abstract and users lose flexibility.

  2. Performance Optimization: With complex robot programs, the team had to optimize how blocks are rendered and executed to maintain smooth performance.

  3. Bridging Visual and Text: The seamless transition between Blockly and Python code became their killer feature, allowing users to start visually and gradually transition to text programming.

  4. Continuous User Testing: Regular testing with different user groups (students, teachers, researchers) was essential to refining the block interface.

Future Development

Niryo continues to evolve their Blockly implementation with several upcoming features:

  • Simulation integration: Preview robot movements directly within the Blockly environment
  • AI-assisted programming: Suggesting blocks based on common patterns
  • Collaborative editing: Allowing teams to program robots together in real-time
  • Extended block libraries: Adding support for computer vision and advanced sensing

Conclusion

Niryo's implementation of Blockly demonstrates how visual programming can make complex robotics accessible without sacrificing power or flexibility. By thoughtfully designing their block system and creating a seamless bridge to Python code, they've created an educational robotics platform that scales from beginners to experts.

<ContactCTA title="Want to feature your company's Blockly implementation?" buttonText="Submit Your Case Study" link="/submit-case-study" />

Get More Case Studies

Subscribe to our newsletter to receive the latest case studies and learn how others are using Blockly.

By subscribing, you agree to our Privacy Policy. We'll send you relevant content, and you can unsubscribe at any time.