top of page
Blue Gradient

Project development with ROS

After discussing with the main supervisor, the initial idea was decided to design the robot using SolidWorks and then import it into ROS Gazebo for simulation. Initially, ROS1 was chosen as the primary flexible framework for writing robot software. ROS, which was introduced in 2007, is an open-source framework that facilitates the development and reuse of code between robotic applications.

https://ubuntu.com/robotics/what-is-ros#:~:text=The%20Robot%20Operating%20System%20(ROS,accessible%20and%20available%20to%20everyone

​​

As it uses a custom serialization format, a custom transport protocol and a custom central discovery mechanism, the idea was it could help for a better simulation for the robot.

​http://design.ros2.org/articles/changes.html#:~:text=ROS%201%20uses%20a%20custom,based%20on%20the%20DDS%20standard

 

After careful consideration of various factors, the decision was made to change the simulation platform for the wheel-legged biped robot from ROS Gazebo to a different simulator. One of the main concerns was the fact that ROS1, which was being used as the main flexible framework for writing robot software, is only supported until 2025. After that, there will be no officially supported ROS1 release, which could cause potential issues for future developments.

In order to ensure the longevity and sustainability of the project, it was deemed necessary to switch to a simulation platform that has a longer support lifespan. After conducting research and evaluating various options, a new simulator was selected that meets the project's requirements and has a more stable and supported platform.

The decision to switch simulators was not taken lightly, and extensive research and analysis were conducted to ensure that the new simulator would not only meet the project's needs but also be adaptable to future changes and developments. The team is confident that this decision will lead to a more sustainable and long-term solution for the project.

​https://discourse.ros.org/t/ros1-or-ros2/20223

 

Controlling a two-wheel biped robot in ROS1 Gazebo involves several steps, including building the robot model, creating controllers, and setting up the simulation environment. The following is an overview of the process.

Firstly, a 3D model of the robot needs to be created using a CAD tool which is SolidWorks. This model should include all the necessary components, such as the wheels, motors, sensors, and the robot's body. Once the 3D model is created, it needs to be exported in the Unified Robot Description Format (URDF) to be used in Gazebo.

Next, controllers need to be developed to control the robot's movement. ROS provides various controllers, including the Proportional-Integral-Derivative (PID) controller, which can be used to control the robot's position or velocity. The controllers can be implemented using either Python or C++.

After the model and controllers are created, a Gazebo simulation environment needs to be set up. This involves creating a launch file that will launch the robot model, the controllers, and any other necessary plugins or ROS nodes. The launch file should also specify the robot's initial position and any environmental parameters, such as gravity or friction.

Once the simulation environment is set up, the robot's movement can be controlled by publishing messages to the controllers. For example, a Twist message can be published to the robot's wheel controllers to set its velocity. Similarly, a JointState message can be published to control the robot's joint angles.

The controlling of a two-wheel biped robot in ROS1 Gazebo involves creating a 3D model of the robot in URDF format, developing controllers to control the robot's movement, setting up a Gazebo simulation environment, and publishing messages to the controllers to control the robot's movement.

Blue Gradient

Controlling a two-wheel biped robot in ROS1 involves several steps. Here is a brief overview of the process:

 

  1. Design the robot in SolidWorks or another CAD software. This involves creating a 3D model of the robot and its components.

  2. Export the model from SolidWorks in a format that can be imported into ROS1 Gazebo. The recommended format is URDF (Unified Robot Description Format).

  3. Create a ROS1 package for the robot. This involves creating the necessary directory structure and files, including the URDF file, launch files, and any additional configuration files.

  4. Use ROS1 packages such as robot_state_publisher, joint_state_publisher, and gazebo_ros to simulate the robot in Gazebo. This involves launching a Gazebo simulation environment, spawning the robot model, and configuring the robot's controllers and sensors.

  5. Write ROS1 nodes to control the robot. This involves creating ROS1 nodes to send commands to the robot's actuators based on sensor data, such as IMU readings or joint positions.

  6. Test and refine the robot's control algorithms in simulation. This involves iteratively modifying the ROS1 nodes and Gazebo simulation environment to improve the robot's performance.

  7. Once the robot is performing well in simulation, deploy the ROS1 nodes to the robot's real hardware and test in the real world.

 

Overall, controlling a two-wheel biped robot in ROS1 involves a combination of CAD design, simulation, and software development using ROS1 packages and nodes.

 

To import a SolidWorks robot into ROS1 Gazebo, you will need to convert the SolidWorks model into the Unified Robot Description Format (URDF) and then use the gazebo_ros package to spawn the robot in Gazebo. Here are the general steps to do this:

 

 

  1. Design the robot in SolidWorks or another CAD software.

  2. Export the SolidWorks model as a .stl file.

  3. Use a software tool such as the SolidWorks to URDF Exporter or the sw_urdf_exporter package to convert the .stl file into a URDF file.

  4. Edit the URDF file to add any additional information that may be required, such as joint limits or controller configuration.

  5. Create a ROS1 package for the robot.

  6. Add the URDF file to the ROS1 package under the urdf directory. 

  7. Create a launch file for the robot simulation, which includes the gazebo_ros package and specifies the path to the URDF file.

  8. Launch the simulation by running the launch file. This will spawn the robot in Gazebo and allow you to control it using ROS1 nodes.

 

The process of importing a SolidWorks robot into ROS1 Gazebo involves converting the model into a URDF file and then using the gazebo_ros package to spawn the robot in Gazebo.

 

This is an XML file written in the URDF format. It describes a robot that has a base link and two wheels. The base link has an inertial element (mass and inertia tensor), a visual element (a mesh file with a color), and a collision element (a mesh file). The two wheels also have inertial, visual, and collision elements. There is also a joint called "wheel1_j" which connects the base link to wheel1 with a revolute type joint that allows rotation around the x-axis. The joint has limits on its rotation. It describes a robot consisting of three links: "base_link", "wheel1", and "wheel2". The robot has two revolute joints connecting the "base_link" to "wheel1" and "wheel2". The file specifies the inertial and visual properties of each link and the joints connecting them. The visual properties include the 3D mesh files used for visualization and the colors of each link. The code is generated by SolidWorks to URDF Exporter tool.

The main code is given below : (Figure: Awheel legged biped robot URDF Code)

11111.png
33333.png
55555.png
2222.png
4444.png
6666.png
Blue Gradient

After many struggles and meetings with the supervisors the decision has changed from Ros1 gazebo to Matlab simscape as it is a more powerful simulation software. That being said, SimScape is a comprehensive physical modeling and simulation tool that integrates well with MATLAB Simulink, which is a widely used tool for system modeling and simulation. SimScape provides a large library of pre-built models of mechanical, electrical, and hydraulic systems that can be easily combined to build complex models. Additionally, SimScape allows for the creation of custom models with a high degree of control and customization.

On the other hand, ROS1 Gazebo is a popular open-source robotics simulation tool that is well-suited for simulating robot behavior and testing robot control algorithms. It allows for the simulation of complex robot models with a variety of sensors and actuators, and can simulate both physical and environmental interactions.

In summary, SimScape is a powerful tool for physical modeling and simulation, while ROS1 Gazebo is a specialized tool for simulating robots and their behavior. The choice between the two depends on the specific needs of the simulation, as well as the user's familiarity and experience with each tool.

bottom of page