JSDaleman's ROS, MQTT, Gazebo, RViz 'starter kit' for EV3 drive base #1674
Growflavor
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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/
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 -cs
main" > /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
Beta Was this translation helpful? Give feedback.
All reactions