"With Docker, developers can build any app in any language using any toolchain. “Dockerized” apps are completely portable and can run anywhere - colleagues’ OS X and Windows laptops, QA servers running Ubuntu in the cloud, and production data center VMs running Red Hat.
Developers can get going quickly by starting with one of the 13,000+ apps available on Docker Hub. Docker manages and tracks changes and dependencies, making it easier for sysadmins to understand how the apps that developers build work. And with Docker Hub, developers can automate their build pipeline and share artifacts with collaborators through public or private repositories.
Docker helps developers build and ship higher-quality applications, faster." -- What is Docker
docker pull michdo93/ros-kinetic-pepper
The container needs admin permissions because it uses systemd. So you have to run something like following:
docker run --net=host -d -it --name <container_name> --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro <image_name>
As example:
docker run --net=host -d -it --name ros-kinetic-pepper --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro ros-kinetic-pepper
If you want to run the container after your system is restarted, please add --restart=always. The argument --net=host will make the container use the ip address of the host system. This is needed if you want to run the roscore for public access which means that you can communicate with your robot(s).
(Please notice that ROS needs a bash shell).
docker exec -it <container_name> /bin/bash
Of coure you can open multiple bash shell's.
Before shutting down your host system or stopping the docker container you should save changes you made in the container otherwise it will be lost.
docker commit <container_name> <image_name>:<tag>
As example:
docker commit ros-kinetic-pepper ros-kinetic-pepper:11/29/2021
You can stop a container with:
docker stop <container_name>
Please notice if you commited the container because of changes you should remove the old container before starting the new container. You can do that with:
docker rm <container_name>
docker restart <container_name>
Please notice that restart only works if the container is shut dowm but not removed!
docker run --net=host -d -it --name <container_name> --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro <image_name>
Maybe you want ro run another version of your image as example with commited changes:
docker run --net=host -d -it --name <container_name> --privileged -v /sys/fs/cgroup:/sys/fs/cgroup:ro <image_name>
Instead of using tigervnc directly with a VNC viewer, please use a browser and the Web Interface of noVNC.
noVNC is both a HTML VNC client JavaScript library and an application built on top of that library. noVNC runs well in any modern browser including mobile browsers (iOS and Android).
Go to https://<your_hostname_or_ip>:6901.
Username: ubuntu
Password: ubuntu
Click on the left panel on the A button and select one of the special keys.
Click the clipboard icon on the left panel. Copy from the VNC desktop or paste to the VNC desktop using the textfield as clipboard for copy/paste.
Click on the settings icon on the left panel. Then change the scaling mode to locally scaling.
After that open a terminal window inside the noVNC desktop environment and run xrandr to see all posible resolution modes. In the next step you can change the resolution by running sudo xrandr --ouptut <display_name> --mode <favourite_resolution>.
You can run VS Code if you open a terminal in the noVNC desktop enviroment and run code. If you want to open a whole directory you can navigate to it and run:
cd <path/to/directory>
code .
or
code <path/to/directory>
ROS Kinetic Kame is automatically started after system boot if you run this container on startup with --restart=always. If the container is started a systemd service will start the roscore so you do not have to execute roscore in a bash shell.
You do not have to parse environment variables to the docker container by starting the container. The environment variables $ROS_DISTRO, $ROS_HOSTNAME, $ROS_MASTER_URI and $ROS_IP are set inside the /etc/environment file of the docker container. Optionally you have to change the $ROS_IP that the roscore ir ROS Master is in the same network as your robot(s).
You can check following:
echo "$(hostname -I | awk '{print $1;}')"
echo "$(hostname -I | awk '{print $2;}')"
Please make sure that you change the ROS_IP="$(hostname -I | awk '{print $2;}')" or ROS_IP="$(hostname -I | awk '{print $2;}')"line inside the/etc/environment` before running the roscore. Maybe you have to restart the roscore.service.
The roscore.service is used to run the roscore.
You can start the roscore.service with:
sudo systemctl start roscore.service
It normally should be started on boot with sudo systemctl enable roscore.service.
You can check the status with:
sudo systemctl status roscore.service
You can stop the roscore.service with:
sudo systemctl stop roscore.service
If you want to disable the roscore.service you can run:
sudo systemctl disable roscore.service
You can restart the roscore.service with:
sudo systemctl restart roscore.service
Please notice that you also have to commit your docker file if you make changes to the settings of the roscore.service.
The roslaunch.service is used to run (multiple) launch files by starting the docker container. Please change the /usr/sbin/roslaunch file for adding (multiple) launch files:
#!/bin/bash
source /home/ubuntu/catkin_ws/devel/setup.bash
source /etc/environment
export ROS_HOME=$(echo /home/ubuntu/.ros
# place your roslaunch command here! &
PID=$!
wait "$PID"
You can start the roslaunch.service with:
sudo systemctl start roslaunch.service
It normally should be started on boot with sudo systemctl enable roslaunch.service.
You can check the status with:
sudo systemctl status roslaunch.service
You can stop the roslaunch.service with:
sudo systemctl stop roslaunch.service
If you want to disable the roslaunch.service you can run:
sudo systemctl disable roslaunch.service
You can restart the roslaunch.service with:
sudo systemctl restart roslaunch.service
Please notice that you also have to commit your docker file if you make changes to the settings of the roslaunch.service.
Now we are good to go! To bring-up Pepper with all actuators and sensors, we run:
Terminal 1:
roslaunch pepper_dcm_bringup pepper_bringup.launch robot_ip:=<yourRobotIP> network_interface:=<eth0|wlan0|vpn0>
Terminal 2:
roslaunch pepper_bringup pepper_full.launch nao_ip:=<yourRobotIP> roscore_ip:=<roscore_ip> network_interface:=<eth0|wlan0|vpn0>
The first parameter specifies the IP of your robot. Since there is no roscore running on the robot, we have to tell which roscore IP to use. That's the second parameter. The third parameter network_interface specifies the network interface the bridge is connected. By default, this is set to eth0. Changing this becomes important to establish a correct network connection between robot and computer, when you are connected via a different network device, such as wlan0 or vpn0 etc. In case you are not certain which device to use, verify with ifconfig and verify which network device has the correct IP.
If you want to execute the Python bridge, we launch the second launch file.
Terminal 1:
roslaunch pepper_dcm_bringup pepper_bringup.launch robot_ip:=<yourRobotIP> network_interface:=<eth0|wlan0|vpn0>
Terminal 2:
roslaunch pepper_bringup pepper_full_py.launch nao_ip:=<yourRobotIP> roscore_ip:=<roscore_ip> network_interface:=<eth0|wlan0|vpn0>
NOTE If you start the bridge without launching a core, the launch file will automatically start one. This can be convenient, but if you keep turning your bridge on and off, it is better to keep a core open in the background, especially if you use RViz or if you kill the bridge brutally.
You also can run the Pepper bringup inside a bash shell without noVNC.
In order to visualize Pepper in RViz, simply open up a new RViz. Please take care to source your setup.bash as before.
rosrun rviz rviz
Notice this only works if you are using the noVNC desktop environment!
We provide a pre-configured RViz configuration which has all basic displays such as TF, RobotModel, Camera, Lasers and Sonars. This configuration can be found inside your catkin workspace under
src/pepper_description/config/pepper.rviz
You can run:
rosrun rviz rviz -d ~/catkin_ws/src/pepper_description/config/pepper.rviz
comming soon:
http://wiki.ros.org/pepper/Tutorials/Calibration http://wiki.ros.org/pepper_bringup http://wiki.ros.org/pepper_dcm_bringup https://github.com/ros-naoqi/pepper_moveit_config https://github.com/ros-naoqi/pepper_virtual
https://raw.githubusercontent.com/Michdo93/test2/main/gazebo.JPG https://raw.githubusercontent.com/Michdo93/test2/main/moveit.JPG https://raw.githubusercontent.com/Michdo93/test2/main/pepper_image_raw.JPG
Content type
Image
Digest
Size
2.3 GB
Last updated
almost 5 years ago
docker pull michdo93/ros-kinetic-pepper