bysenseSim
Last updated
Last updated
bysenseSim is an open toolset designed to help you gain hands-on experience with bysense. Built on Gazebo, ROS2, and RViz, it provides a comprehensive simulation environment, allowing you to get bysense up and running without requiring physical hardware. Whether you're a beginner exploring robotics or an experienced developer creating complex applications, this repository offers everything you need to start quickly and efficiently— we bring sensors to walk!
E-mail: welcome@bywerks.com Discord : https://discord.gg/3cqSVjfBsY
This repo was tested on the following setup:
bysenseSim features three core components:
Purpose: Provides a Gazebo simulation environment with full setup, ROS2 control integration, and RViz visualization capabilities.
Features: - Gazebo Integration: Tailored for quadruped robots, including custom world files, optimized update frequency, and seamless functionality. - ROS2 Control Interface: Enables smooth interaction with simulated quadruped components. - Real-Time Visualization: Offers high-performance visualization of robot states and movements in RViz. - URDF and Plugins: Includes an adapted URDF model with plugins, specifically configured to meet Gazebo’s requirements, incorporating friction, IMU, and other essential parameters and plugins.
Purpose: A low-level C++ controller responsible for fast actuation and stability
Features: - High-Frequency PD Control: Operates at 1 kHz to ensure stable and accurate movements, with customizable PD gains for specific applications. - Real-Time Updates: Enables fast data exchange with the high-level controller for responsive and dynamic performance.
Purpose: A Python-based module for controlling the quadruped’s high-level actions, empowering users to design and execute robot missions in simulation.
Features: - RL-Based Walking Policy: Integrates a reinforcement learning policy within the repository, enabling autonomous quadruped walking with pre-trained, adaptive behaviors. - Built-In Actions: Provides essential actions like standup, sit down, and walk, streamlining mission creation. - Flexible Mission Creation: Allows for user-defined mission scripts, ensuring an easy transition from simulation to real hardware.
This dev kit's modularity empowers robotics enthusiasts and professionals alike to design, refine, and execute custom quadruped missions. The inclusion of an RL-based walking policy highlights its advanced capabilities, making it an excellent framework for both learning and high-level development.
After you have installed the required Ubuntu, ROS2 version with Gazebo and Rviz, we recommend to check if the versions are correct in your terminal and compare it with our txt: ros2_packages.txt
Check if all packages are installed
If the list of the items is the same or similar, continue.
Once this step is done, lets move on.
You can find the launch files under bysensesim/launch
. We will go now through the most important files:
If you are already in the workspace folder (bysensesim_ws) run:
Switch folder into bysense_highlevel
.
Use this line of code to start gazebo and RViz next to each other:
If no errors pop up in the terminal, you should then get this view:
The first time you start, double check if following are green:
If yes, they are loaded and ready to be used in our scripts later.
Use this method if you are only interested to use gazebo alone:
To double check if all is working fine when coding, run in a second terminal in the same folder:
as a result you should get:
once this list is the same you can assume all is loaded and you can continue with use cases below.
For specific purposes, it makes sense to only start RViz with its link controller:
You can use this to check joint positions, configurations and read out positions which you would need in your custom scripts.
After you opened Gazebo or RViz it's time to work with custom code. First we switch into the bysense_highlevel folder:
As mentioned before, the low level in bysense_controller runs at 1kHz in background. Over the ROS2 nodes we will communicate inputs for joints, directions, angles, IMU etc. Many of those examples you find the scripts within the folder above.
After you opened and run Gazebo open a second terminal and type:
Watch the quadruped move from its initial spawn position to perform standup
.
Once your mission is done you can sitdown:
One of the most important parts of a legged robot are its walking skills. For the initial release we added a kinematic based walking which can be found under:
The input to this file can be a direction vector to x, y and, if needed, in z. The walking is based on inverse kinematic and the steps are generated in Bezier curves. The walk gait is pretty basic and we plan to extend this in near future.
Go to main.cpp file under bysense controller. Change there the kp/kd values. Close the running apps like Gazebo and/or RViz and rebuild:
Would you wish to have yaml file as parameter to change those values? - Let us know!
the current robot description file will be wrapped into a more modular approach. This will ensure a easy integration of your sensor and various other payloads.
Under the high level controller, we are working to get a pre-trained policy to walk within gazebo. The input to this policy is an observation vector based on multiple input parameters like: linear velocity, projected gravity vector, position and velocity of the joints. Next step is to get the policy to run in Gazebo like in here:
This simulation is based on our urdf which is provided in this repo too! So far we experimented with various parameters and could not find the optimal solution to get it to walk optimally in Gazebo. More updates will follow!
Initially we started with a ground plane to showcase the base functions. To take full advantage of walking robots we plan to add a uneven terrain/ground
Another feature we plan to add is to bring the robot to standup back after it has fallen.
We plan to upgrade to another Gazebo Version. Let us know which one you prefer!
We do think of adding other tools to visualize parameters in the simulation.
If you have further idea/wishes let us know and join our discord server: https://discord.gg/3cqSVjfBsY