A Quadruped simulator that has both a ros2 simulation as well as a pybullet simulation for Simple testing. The physical Quadruped is inspired from the OpenQuadruped (spot-mini-mini)
To build and flash the ESP32 using Micro ROS and ESP-IDF.
-
Clone the
micro_rossetup repo and build it.# Source the ROS 2 installation source /opt/ros/$ROS_DISTRO/setup.bash # Create a workspace and download the micro-ROS tools mkdir ~/uros_ws cd ~/uros_ws git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup # Update dependencies using rosdep sudo apt update && rosdep update rosdep install --from-paths src --ignore-src -y # Install pip sudo apt-get install python3-pip # Build micro-ROS tools and source them colcon build source install/local_setup.bash
-
Creating firmware workspace for ESP-IDF and FreeRTOS parts.
# This might take a while to build. ros2 run micro_ros_setup create_firmware_ws.sh freertos esp32 -
Copy your changes to the
uros_wsrepo for building and flashing.cp -r ~/scout_ws/src/scout_hardware/hardware_interface firmware/freertos_apps/apps/ -
Configuring the firmware
ros2 run micro_ros_setup configure_firmware.sh hardware_interface -t serial
- The options available for this configuration step are:
--transportor-t: udp, serial or any hardware-specific transport label--devor-d: agent string descriptor in a serial-like transport--ipor-i: agent IP in a network-like transport--portor-p: agent port in a network-like transport
- The options available for this configuration step are:
-
Building the firmware
ros2 run micro_ros_setup build_firmware.sh
-
Connect the ESP32 and flash the firmware - Make sure to remove the board from sensors or power off the sensors
ros2 run micro_ros_setup flash_firmware.sh
-
Creating the micro-ROS agent
source install/local_setup.bash # Download micro-ROS-Agent packages ros2 run micro_ros_setup create_agent_ws.sh # Build step ros2 run micro_ros_setup build_agent.sh source install/local_setup.bash
-
Run the micro-ROS agent
- Make sure to replace
/dev/ttyUSB0with your serial device. - After running press the EN button on the ESP32 board to start the micro-ROS node.
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyUSB0
- Make sure to replace
-
Testing the setup
- You should be able to see the topics from the micro-ROS node now.
ros2 topic list
- You should see something like this:
/servo_angles/radians
- You can publish to the topic to move the servos.
# This is the squate pose that the robot starts in.(so you might not see any movement) ros2 topic pub /servo_angles/radians std_msgs/msg/Float32MultiArray "{data: [0.15192765, 0.7552236, -1.5104472, -0.15192765, 0.7552236, -1.5104472, 0.15192765, 0.7552236, -1.5104472, -0.15192765, 0.7552236, -1.5104472]}"
- Clone the repo
git@github.com:mathewp88/scout.git
- Install rosdeps
rosdep install --from-paths src --ignore-src -r -y
(If you are not in a python env, you may need to run with the PIP_BREAK_SYSTEM_PACKAGES=1 flag)
- View the robot in rviz
ros2 launch scout_description description.launch.py
- Launch gazebo simulation
ros2 launch scout_gazebo gazebo.launch.py