Robotics

Computing & Languages in Robotics

Robotics development uses a mix of languages and tools chosen for performance, ease of prototyping, hardware access, and ecosystem support. Common choices:

Where each language is used — practical notes

Practical sensor & actuator examples

Below are concrete code examples you can run (or adapt) on robot hardware or simulators. These show reading a distance sensor, controlling a motor, and publishing to ROS.

# Python: read a HC-SR04-like ultrasonic sensor via GPIO (example for Raspberry Pi)
import time
import RPi.GPIO as GPIO

TRIG = 23
ECHO = 24

GPIO.setmode(GPIO.BCM)
GPIO.setup(TRIG, GPIO.OUT)
GPIO.setup(ECHO, GPIO.IN)

def read_distance_cm():
    GPIO.output(TRIG, False)
    time.sleep(0.0002)
    GPIO.output(TRIG, True)
    time.sleep(0.00001)
    GPIO.output(TRIG, False)

    start = time.time()
    while GPIO.input(ECHO) == 0:
        start = time.time()
    while GPIO.input(ECHO) == 1:
        stop = time.time()
    elapsed = stop - start
    distance = (elapsed * 34300) / 2  # speed of sound 34300 cm/s
    return distance

try:
    while True:
        d = read_distance_cm()
        print(f"Distance: {d:.1f} cm")
        time.sleep(0.2)
except KeyboardInterrupt:
    GPIO.cleanup()
/* Arduino: simple PWM motor control using L298N or motor driver */
const int pwmPin = 5;    // PWM pin to motor driver EN
const int in1 = 7;    // direction pin 1
const int in2 = 8;    // direction pin 2

void setup() {
    pinMode(pwmPin, OUTPUT);
    pinMode(in1, OUTPUT);
    pinMode(in2, OUTPUT);
    analogWrite(pwmPin, 0);
}

void loop() {
    // Run forward
    digitalWrite(in1, HIGH);
    digitalWrite(in2, LOW);
    for (int speed = 0; speed <= 200; speed += 10) {
        analogWrite(pwmPin, speed);
        delay(100);
    }
    delay(1000);
    // Stop
    analogWrite(pwmPin, 0);
    delay(500);
    // Run backward
    digitalWrite(in1, LOW);
    digitalWrite(in2, HIGH);
    analogWrite(pwmPin, 180);
    delay(1000);
    // Slow down
    analogWrite(pwmPin, 0);
    delay(2000);
}
# ROS2 (rclpy) example: publish distance sensor readings
import rclpy
from rclpy.node import Node
from sensor_msgs.msg import Range

class RangePublisher(Node):
    def __init__(self):
        super().__init__('range_publisher')
        self.pub = self.create_publisher(Range, 'sonar_range', 10)
        self.timer = self.create_timer(0.1, self.timer_callback)
        self.seq = 0

    def timer_callback(self):
        msg = Range()
        msg.header.stamp = self.get_clock().now().to_msg()
        msg.header.frame_id = 'sonar_link'
        msg.radiation_type = Range.ULTRASOUND
        msg.field_of_view = 0.5
        msg.min_range = 0.02
        msg.max_range = 4.0
        msg.range = read_distance_cm() / 100.0  # convert cm to meters
        self.pub.publish(msg)
        self.get_logger().info(f"Published range: {msg.range:.2f} m")

def main(args=None):
    rclpy.init(args=args)
    node = RangePublisher()
    rclpy.spin(node)
    node.destroy_node()
    rclpy.shutdown()

if __name__ == '__main__':
    main()

Sensor fusion & control loop example

A practical robot will fuse IMU + encoder + vision to estimate pose, then run a control loop (PID or model predictive control). Below is pseudocode for a simple fusion loop and PID velocity control.

# Pseudocode: sensor fusion (IMU + wheel odometry) and PID velocity control
state = {'x':0,'y':0,'theta':0, 'vx':0,'vy':0}
pid = PID(kp=1.0, ki=0.1, kd=0.01)

while True:
    imu = read_imu()                  // returns angular rates and linear accel
    odo = read_wheel_encoders() // returns delta ticks per wheel
    vision = read_vision_pose() // optional pose update from camera
    dt = compute_dt()
    odo_delta = odometry_from_encoders(odo, dt)
    # prediction step from IMU + odometry
    state = predict_state(state, imu, odo_delta, dt)
    if vision is not None:
        state = correct_state_with_vision(state, vision)
    # velocity control: compute required wheel commands
    desired_v = planner_next_velocity()
    error = desired_v - state['vx']
    ctrl = pid.update(error, dt)
    apply_motor_commands(ctrl)
    sleep(dt)

Famous Robots

Rashmi

Rashmi is a multilingual humanoid built for public engagement and education.
She uses a microphone array and beamforming to capture speech in noisy spaces.
Vision modules detect faces and pose so Rashmi can maintain polite eye contact.
Facial actuators (small servos) synchronize with speech to produce expressions.
Torso and arm motion use brushless motors with encoders for repeatable gestures.
A local dialog manager maps detected intents to scripted educational interactions.
Rashmi logs anonymized interaction metrics that teachers can review later.
Safety sensors (proximity ring, bump switches) stop motion if people get too close.
Maintenance focuses on actuator calibration, battery checks, and ASR model updates.
Rashmi demonstrates culturally aware robotics by combining speech, vision, and safe motion.

Champak

Champak is a child-focused storytelling and quiz robot for museums and classrooms.
Stereo cameras and simple pose estimation help Champak find and address its audience.
Directional audio and a DSP ensure clear playback without flooding the room with noise.
Micro-servo driven gestures synchronize with narration to make stories engaging.
Touch and proximity sensors let children interact directly and safely with the robot.
Content modules are stored locally and uploaded via a teacher-facing web UI.
Champak adapts question difficulty based on live quiz performance metrics.
Pressure sensors on the case trigger immediate soft-stops to prevent injury on contact.
Routine maintenance: check servos, update content packs, and refresh battery cycles.
Champak blends perception, safe actuation, and curriculum-driven interaction for learning.

Mitra

Mitra is a service humanoid used for visitor guidance and basic assistance in public spaces.
She navigates with LiDAR-based SLAM plus short-range depth sensing for obstacle avoidance.
Face detection and optional embedding-based recognition enable personalized greetings (consent-based).
Position-controlled motors with torque sensing allow Mitra to gesture safely and reliably.
The software stack separates navigation, interaction, and safety with independent watchdogs.
Docking routines and scheduled charging keep Mitra available during peak hours.
Practical deployments include hospitals and corporate lobbies for wayfinding and FAQs.
Remote supervision tools let human operators intervene or teleoperate when needed.
Maintenance includes map cleanup, speech-model retraining, and regular sensor calibration.
Mitra shows how perception, enterprise APIs, and safe motion combine for useful service robots.

RADA

RADA assists customers in banks and offices with queue management and information delivery.
Interfaces include touchscreen menus, voice queries, and LED visual guidance for clarity.
Overhead or onboard cameras provide analytics for queue length and flow optimization.
RADA integrates with appointment systems to present anonymized schedules and suggestions.
Localization can use ORB-SLAM variants for branches that change layout frequently.
Safety features include soft bumpers, E-stop, and remote teleoperation fallback modes.
Operators monitor RADA via dashboards that report uptime, interactions, and error logs.
Updates to dialogues and UI modules are rolled out during off-peak windows to avoid downtime.
Operational metrics tracked: average wait reduction, user satisfaction, and service accuracy.
RADA demonstrates enterprise integration of robotics without exposing sensitive customer data.

ASIMO

ASIMO is a pioneering bipedal humanoid developed for stable walking and human interaction.
Its gait relied on ZMP-based balance control with high-frequency joint feedback loops.
Sensors included encoders, IMUs, and stereo vision to perceive terrain and obstacles.
ASIMO demonstrated autonomous stair climbing with foot-placement planning and balance compensation.
Actuation used precision motors and gearings tuned for smooth multi-joint coordination.
High-level planning generated gestures and trajectories while low-level loops handled safety and tracking.
Maintenance involved frequent calibration of sensors and re-tuning gait parameters after wear.
ASIMO’s research contributions influenced later humanoid walking and whole-body planning work.
Public demos showed how mobility and social interaction can be combined safely on stage.
ASIMO remains a milestone in humanoid mechanics, control, and integrated sensing.

Sophia

Sophia is a social humanoid known for expressive facial motion and conversational demos.
Micro-actuators beneath a flexible face material create nuanced eyebrow, lip, and cheek movements.
Vision and audio processing align gaze and speech timing for natural-feeling interactions.
Dialog systems mix rule-based safety layers with generative models for richer replies.
Moderation and guardrails are used to filter inappropriate or unsafe outputs in public talks.
Sophia’s design highlights mechanical expressivity combined with perception and language models.
Operational needs include actuator maintenance, model updates, and careful public moderation.
Sophia’s appearances often prompt public discussion about ethics, persona, and AI limits.
Her case emphasizes the importance of safety layers and content filtering in social robots.
Sophia demonstrates how expressive hardware and dialog software can create engaging demonstrations.

Atlas

Atlas is a high-performance humanoid focused on dynamic agility, balance, and recovery.
It combines low-latency sensing (IMUs, joint encoders) with powerful actuators for fast motion.
Model-predictive and trajectory-optimization controllers enable jumps, runs, and push recovery.
Depth sensing and state estimation provide terrain awareness for foot-placement planning.
Simulation-first workflows and domain randomization reduce risk before hardware trials.
Thermal and battery management are engineered to support repeated high-power operations.
Research uses include mobility tests for search-and-rescue and uneven-terrain traversal.
Safety interlocks and constrained control outputs protect hardware and nearby humans during tests.
Atlas represents the frontier of legged and bipedal dynamic control research and demonstration.
Its development shows how control theory and high-bandwidth mechanics enable agile behaviors.

Spot

Spot is a versatile quadruped used for inspection, mapping, and remote sensing tasks.
It adapts gait and foothold selection for stairs, slopes, and rough terrain for reliable access.
Payloads commonly include LiDAR, thermal cameras, and RGB rigs for automated inspections.
Operation modes: teleoperation, waypoint navigation, and scripted mission sequences for repeatability.
Spot’s mapping output integrates with BIM or site models for deviation analysis and reporting.
Safety includes obstacle detection, remote stop, and recovery behaviors if tripped or stuck.
Industrial use-cases: construction progress scans, site health checks, and confined-space inspection.
Routine checks cover battery health, motor calibration, and payload mounting integrity.
Spot shows how legged platforms expand access compared to wheeled robots in complex sites.
It highlights practical mission scripting and sensor fusion for automated inspection workflows.

Solaris

Solaris is a solar-powered field robot used for long-duration environmental and agricultural sensing.
Photovoltaic panels and an energy-aware scheduler extend operational uptime between maintenance visits.
Sensors include multispectral cameras, soil moisture probes, and micro-weather stations for local microclimate data.
Onboard edge analytics compute NDVI-like indices to detect crop stress and prioritize areas for inspection.
Sampling rates are duty-cycled: high-frequency sensing during peak solar input, low-power standby at night.
Solaris uploads batched data during high-insolation windows to conserve energy on cellular links.
Deployments focus on irrigation alerts, crop health mapping, and remote site monitoring with low maintenance footprint.
Design priorities: ruggedization, easy field servicing, and integration with farm-management systems.
Energy-aware behavior makes Solaris a practical example of sustainable, remote-capable robotics.
It demonstrates trade-offs between sensing fidelity and long-term power autonomy in the field.

Curiosity

Curiosity is a Mars rover that performs autonomous navigation, sampling, and on-board science analysis.
Navigation fuses stereo vision, visual odometry, IMU data, and wheel odometry for robust traverse planning.
The robotic arm contains a drill, scoop, and sample-handling mechanisms to prepare materials for instruments.
Autonomy includes hazard detection, path planning, and mission-sequence execution with fault protection.
Curiosity uses an RTG power source for long-term, sunlight-independent operation on Mars.
Science workflows include target imaging, sample acquisition, instrument sequencing, and data compression for downlink.
Robust state machines and conservative autonomy ensure survival across power and thermal cycles.
Long-duration maintenance focuses on software updates, wheel health monitoring, and conservative planning to reduce wear.
Curiosity exemplifies integrated sensing, mechanical tooling, and robust autonomy in extreme environments.
Its mission shows how robotics enables remote science where humans cannot operate directly.

Other important topics in robotics

Robotics covers many areas beyond sensors, actuators, and motion. Below are additional topics worth knowing before moving to MCQs.

Deployment patterns & operational tips

  1. Roll out features in gated stages: simulation → lab → small pilot → scaled deployment.
  2. Use feature flags and remote configuration to tweak behavior without redeploying firmware.
  3. Instrument health endpoints and heartbeat metrics; surface them on dashboards for ops teams.
  4. Automate OTA updates with rollback paths and cryptographic signing to ensure safe upgrades.
  5. Plan maintenance windows and keep a clear incident-runbook for common failure modes.

Regulation, standards & certification

Different industries require different compliance: medical devices, automotive, aviation, and industrial automation each have certification regimes (e.g., ISO, IEC, FDA guidance, automotive safety standards). Early engagement with regulatory requirements avoids expensive rework and ensures public safety.

Ethics & data privacy

Where to focus next (practical)

Conclusion

Robotics is an engineering discipline that mixes hardware, software, and human factors. Success comes from careful system design, staged testing, robust monitoring, and attention to safety, privacy, and maintainability. With methodical practices—modularity, logging, energy-aware behavior, and clear human interfaces—robots can be reliable tools across industry, research, and public service.

MCQs

1. Which programming language is commonly used for quick prototyping and machine learning in robotics?

(a) Java

(b) Python

(c) C#

(d) Kotlin

► (b) Python

2. What is the main purpose of actuators in a robot?

(a) To sense the environment

(b) To control decision making

(c) To convert electrical signals into motion

(d) To store energy

► (c) To convert electrical signals into motion

3. Which robot is specifically designed for child-focused educational interaction?

(a) ASIMO

(b) Rashmi

(c) Champak

(d) Solaris

► (c) Champak

4. Which language is typically used for low-level microcontroller firmware in robotics?

(a) Python

(b) Embedded C

(c) JavaScript

(d) MATLAB

► (b) Embedded C

5. What is the primary function of sensors in robotics?

(a) Execute movement commands

(b) Collect data about the environment

(c) Control energy supply

(d) Simulate algorithms

► (b) Collect data about the environment

6. Which robot is known for expressive facial motion and social interaction?

(a) Atlas

(b) Sophia

(c) Spot

(d) RADA

► (b) Sophia

7. ROS (Robot Operating System) is primarily used for:

(a) Designing robot hardware

(b) Middleware for communication between sensors and controllers

(c) Battery management

(d) Writing web applications

► (b) Middleware for communication between sensors and controllers

8. What is a key safety feature implemented in most humanoid robots like Rashmi and Mitra?

(a) Facial recognition only

(b) Proximity sensors and emergency stop

(c) Random movement patterns

(d) Unlimited speed motors

► (b) Proximity sensors and emergency stop

9. Which robot is designed for dynamic agility, balance, and push recovery research?

(a) Atlas

(b) Curiosity

(c) Champak

(d) Solaris

► (a) Atlas

10. Which robotics topic involves designing interfaces that reduce user stress and increase trust?

(a) ROS programming

(b) Human–robot interaction (HRI)

(c) PID control

(d) Energy management

► (b) Human–robot interaction (HRI)

11. Spot, the quadruped robot, is primarily used for:

(a) Social education

(b) Mars exploration

(c) Inspection, mapping, and remote sensing

(d) Child learning

► (c) Inspection, mapping, and remote sensing

12. What is one practical reason to use Python in robotics?

(a) It is hardware-specific

(b) It integrates well with sensors and machine learning

(c) It cannot run on ROS

(d) It replaces all C++ code

► (b) It integrates well with sensors and machine learning

13. Which robot collects environmental data using solar power and sensors in agriculture?

(a) ASIMO

(b) Solaris

(c) Rashmi

(d) Atlas

► (b) Solaris

14. What is an important practice when deploying robots in real environments?

(a) Directly deploying without simulation

(b) Rolling out features in gated stages (simulation → lab → pilot → full deployment)

(c) Avoid testing

(d) Using unverified firmware updates

► (b) Rolling out features in gated stages (simulation → lab → pilot → full deployment)

15. Which robot performs autonomous navigation and science analysis on Mars?

(a) Spot

(b) Curiosity

(c) Champak

(d) RADA

► (b) Curiosity

16. Why is energy-aware software important in robotics?

(a) To increase maximum speed

(b) To optimize battery life and mission-critical uptime

(c) To replace sensors

(d) To avoid programming errors

► (b) To optimize battery life and mission-critical uptime

17. In ROS2, a “publisher” node is used to:

(a) Control motor speed directly

(b) Send sensor data to other nodes

(c) Store energy

(d) Visualize images

► (b) Send sensor data to other nodes

18. What is the primary goal of modular and upgradable robot design?

(a) To prevent software updates

(b) To allow swapping components without full redesign

(c) To restrict sensor integration

(d) To avoid energy management

► (b) To allow swapping components without full redesign