0

I like to build a robot, that it has an ARM-based computer(like raspberry pi) and Linux OS upon. I like when the user turns on the robot, robot runs it's specific program(that I have written in C language), and doesn't run a general purpose desktop Linux!

For example, when robot turns on, it shows "Hello!" on it's display, Says hello to user, moves his hands, etc (I mean runs only my specified program for it)

How can I do that?

0

If you simply want lightweight operation system on raspberry pi (without desktop environment) then just use "Raspbian Jessie Lite" instead of full one.

If you pretty sure in your programming skills and don't need anything from operation system and you may cover all your needs in a single program you wrote, then you can replace first program that start by linux kernel by changing GRUB initialization string init=/path/to/init_program (make sure you read The system initialization)

If you simply want (I guess it is exactly what you want) just tell operation system to autostart your program on Raspberry Pi, then create or edit your rc.local

   sudo nano /etc/rc.local

and add your program there. (make sure you read everything in official documentation how to do that right way https://www.raspberrypi.org/documentation/linux/usage/rc-local.md)

  • Hi Alex and thanks for help, Actually my board isn't raspberry pi and ait's nanopi-m1. but supports debian jessie,ubuntu mate, ubuntu core, armbian. I use armbian at this time. I'll check the file you said(cc.local) and I think my solution is in your third option as you said. But this is the first part. I mean I want my program starts when the computer turns on, but I like remove other programs like web browser, liber office,etc and don't want they start or occupying my SD card. What about the second part? how can I remove extra apps and deactivate extra parts of OS like desktop environment? – user3486308 Jan 2 '17 at 7:05
  • Cleaning up operation system from desktop environment isn't easy task, you would probably brake some library dependency and will loose a lot of time. I suggest you to download server version of armbian if you'd like to have lightweight system since server version usually doesn't have desktop's stuff. – Alex Jan 2 '17 at 7:46
1

ROS (Robot Operating System) is a set of software libraries and tools that help developers build robot applications from inside another operating system such as Ubuntu. ROS provides hardware abstraction, device drivers, libraries, visualizers, message-passing, package management, and more.

There is a ROS release every year in May. Every ROS release will be supported on exactly one Ubuntu LTS. ROS releases will drop support for EOL (End Of Life) Ubuntu distributions, even if the ROS release is still supported. The ROS Kinetic release is currently supported only on Ubuntu 16.04.

You need to install the full Ubuntu desktop on the computer on which you are developing, and on the ARM-based computer (Raspberry Pi) you should install a much smaller operating system like Ubuntu Core. There are official builds of Ubuntu Core available for Raspberry Pi 2 and Raspberry Pi 3.


ROS Kinetic installation in Ubuntu 16.04

  1. Configure your Ubuntu repositories to allow "restricted", "universe" and "multiverse".

  2. Run these commands:

    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'  
    sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116  
    sudo apt update  
    
  3. Select one of four default ROS configurations.

    sudo apt install ros-kinetic-desktop-full # full desktop
    sudo apt install ros-kinetic-desktop # desktop install
    sudo apt install ros-kinetic-ros-base # no GUI
    sudo apt install ros-kinetic-PACKAGE # individual package installation
    

    To find available packages, use: apt-cache search ros-kinetic and then replace PACKAGE in ros-kinetic-PACKAGE by one of the available packages found by apt-cache search ros-kinetic

  4. Initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.

    sudo rosdep init
    rosdep update  
    
  5. Environment setup

    echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc  
    source ~/.bashrc  
    
  6. Get rosinstall. rosinstall enables you to easily download many source trees for ROS packages with one command.

    sudo apt install python-rosinstall  
    
  7. To test your installation, visit the official ROS Tutorials.


ROS Melodic installation in Ubuntu 18.04

  1. Configure your Ubuntu repositories to allow "restricted", "universe" and "multiverse".

  2. Run these commands:

    sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'  
    sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
    sudo apt update  
    
  3. Select one of four default ROS configurations.

    sudo apt install ros-melodic-desktop-full # full desktop
    sudo apt install ros-melodic-desktop # desktop install
    sudo apt install ros-melodic-ros-base # no GUI
    sudo apt install ros-melodic-PACKAGE # individual package installation
    

    To find available packages, use: apt-cache search ros-melodic and then replace PACKAGE in ros-melodic-PACKAGE by one of the available packages found by apt-cache search ros-melodic

  4. Initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.

    sudo rosdep init
    rosdep update  
    
  5. Environment setup

    echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc  
    source ~/.bashrc  
    
  6. Get rosinstall. rosinstall enables you to easily download many source trees for ROS packages with one command.

    sudo apt install python-rosinstall-generator python-wstool build-essential  
    
  7. To test your installation, visit the official ROS Tutorials.

Source: Ubuntu install of ROS Kinetic, Ubuntu install of ROS Melodic

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.