JSDaleman's ROS, MQTT, Gazebo, RViz 'starter kit' for EV3 drive base #1674
Replies: 3 comments 2 replies
|
ROS1 tutorials: These two provide a sense for what is happening 'under the hood of JSDaleman's ROS1, Gazebo, RViz 'starter kit' for EV3: ROS2 Humble (supported until May 2027) is matched with Ubuntu 22.04 LTS. I used windows 11 hyper-v in this case for a Ubuntu 22.04 LTS vm to make it easier to do the lidar etc. tutorials linked further below since eventually we will use lidar/ROS2/EV3/Rpi setup following the ROS2 Humble documentation was smooth: additional packages: How to prepare your ROS 2 environment note: ROS2 uses colcon build tool rather than catkin ROS2 tutorial playlist (made using ROS2 Foxy) with companion blog & github repo: The camera & lidar parts of the youtube tutorial at the links below are fun/inspirational to watch first just to get a sense of what is possible both via Gazebo simulator & actual cameras/lidar. companion blog: https://articulatedrobotics.xyz/tutorials/ready-for-ros/what-you-need-for-ros/ https://youtube.com/playlist?list=PLunhqkrRNRhYYCaSTVP-qJnyUPkTxJnBt&si=qOuWtnFMEner-6hH youtube: Using ros2_control to drive our robot (off the edge of the bench...) ROSCon 2022 workshop on ros2_control |
|
@Growflavor I’ll prepare a README in English. I’ve gone through all your steps and will include important notes on modifying the setup for a custom MQTT broker, along with the various commands you can use for testing. |
|
In this repository, you will find detailed descriptions for each package as well as the logic behind every component: https://github.com/JSDaleman/ev3dev_ROS/tree/main. |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
@JSDaleman created a very nice ROS, MQTT, Gazebo, RViz with EV3 starter package for the EV3 "Drive base with gyro" briefly mentioned in this post.
Merits being added to https://www.ev3dev.org/projects/
"how you can submit your project page to be hosted on the site": https://www.ev3dev.org/docs/tutorials/adding-new-project/
I used google chrome to translate the github pages describing the setup:
https://github.com/JSDaleman/ev3dev_ROS
https://github.com/JSDaleman/ev3_mqtt_ros
I encountered a number of issues while setting up the WSL2 Ubuntu 20.04, so below are the streamlined steps that actually worked for me.
Configure a free hivemq account:
https://github.com/JSDaleman/ev3_mqtt_ros#-creaci%C3%B3n-de-broker-y-configuraci%C3%B3n
https://console.hivemq.cloud/
EV3 booted with ev3dev:
sudo apt install python3-paho-mqtt
Windows 11 PC:
Ubuntu 20.04 uses Python 3.8.10
wsl --install Ubuntu-20.04
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable
lsb_release -csmain" > /etc/apt/sources.list.d/gazebo-stable.list'wget https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
sudo apt update
sudo apt upgrade
sudo apt install gedit
sudo apt install nautilus
sudo apt install python3-pip
sudo apt install python3-venv
python3 -m pip install --upgrade pip
python3 -m pip install PyQt5
python3 -m pip install paho-mqtt
python3 -m pip install --upgrade paho-mqtt
python3 -m pip install catkin_tools
python3 -m pip install catkin_pkg
python3 -m pip install empy
sudo apt install ros-noetic-desktop-full #https://wiki.ros.org/noetic/Installation/Ubuntu
sudo apt install python3-catkin-tools
sudo apt install python3-rospkg
sudo apt install python3-roslaunch
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
sudo rosdep init
rosdep update
catkin config --extend /opt/ros/noetic
mkdir -p ev3ros/src
cd ev3ros
git clone https://github.com/JSDaleman/ev3_mqtt_ros
cd ev3ros/src
git clone https://github.com/JSDaleman/ev3dev_ROS.git
cd ..
:~/ev3ros$ catkin init
nano ~/.bashrc
Add the following two lines to the end of you .bashrc:
source ~/ev3ros/devel/setup.bash
export PYTHONPATH=$PYTHONPATH:/usr/lib/python3/dist-packages
source ~/.bashrc
Change MQTT broker address to your hivemq URL in these three .py scripts:
ev3ros/src/ev3dev_ROS/mqtt/src/mqtt/mqtt_remote_method_calls.py
def __init__(self, delegate=None, id=1, mqtt_broker_ip="e9d73965c3fe4220b51bf8e5f1365a27.s1.eu.hivemq.cloud"):ev3ros/src/ev3dev_ROS/mqtt/scripts/mqtt_messenger.py
def __init__(self, delegate=None, id=1, mqtt_borker_ip="e9d73965c3fe4220b51bf8e5f1365a27.s1.eu.hivemq.cloud"):ev3ros/ev3_mqtt_ros/Scripts/Robot/mqtt_remote_method_calls.py
def __init__(self, delegate=None, id=1, mqtt_broker_ip="e9d73965c3fe4220b51bf8e5f1365a27.s1.eu.hivemq.cloud")::~/ev3ros$ catkin build
Copy the files from ev3_mqtt_ros/Scripts/Robot over to the EV3 (I used ev3dev extension in VScode):

https://github.com/JSDaleman/ev3_mqtt_ros?tab=readme-ov-file#-carga-de-archivos-al-robot
In the terminals of the demo video you can see the following launch commands:
https://youtu.be/NIEbXVXS-eo?si=NYXHjLuXi48-MR_O&t=13
Run on the PC:
:~/ev3ros$ roslaunch ev3_launch_pkg ev3_teleop.launch
or
:~/ev3ros$ roslaunch ev3_launch_pkg ev3_teleop_simulate.launch
Run on the EV3: (I use Ev3dev extension in VScode to run in interactive terminal)
ev3_MQTT.py
if Rviz does not render the EV3 model, telling openGL to cpu render does work as described in the "known issue":
https://github.com/JSDaleman/ev3dev_ROS/tree/main#-fallas-conocidas
LIBGL_ALWAYS_SOFTWARE=1 rviz
All reactions