Giter Club home page Giter Club logo

robot-modelling's Introduction

Robot Modelling Files

Scratch in ROS and RViz

Explanation of URDF Files and Launch ROS Files

  1. Install and use RVIZ and Other Packages
    • "sudo apt-get install ros-melodic-rviz"
    • "roscore"
    • Go to new terminal "rosrun rviz rviz"
  2. Install for URDF modeling
    • "sudo apt-get install ros-melodic-urdf"
    • "sudo apt-get install liburdfdom-tools"
  3. Create the Workspace and Catkin Package
    • "mkdir -p ~/robot_ws/src"
    • "cd ~/robot_ws"
    • "catkin_make"
    • "source ~/robot_ws/devel/setup.bash"
    • "echo $ROS_PACKAGE_PATH"
    • "cd ~/robot_ws/src"
    • "catkin_create_pkg robot_model_pkg roscpp tf2 geometry_msgs urdf rviz joint_state_publisher_gui"
      • Dependencies:
      • roscpp: cpp and ROS.
      • tf2: Lets the user keep track of multiple coordinate frames over time.
      • geometry_msgs: Messages for common geometric primitives such as points, vectors, and poses.
      • urdf: C++ parser for URDF package
      • rviz: RVIZ
      • joint_state_publisher_gui: Contains a GUI tool for setting and publishing joint state values for a given URDE
  4. Create the URDF file and launch file.
    • "cd ~/robot_ws/src/robot_model_pkg"
    • "mkdir urdf"
    • "mkdir launch"
    • "cd urdf"
    • "gedit robot.urdf" You can find it in README.md file.
    • "cd .."
    • "cd launch"
    • "gedit robot.launch" You can find it in README.md file.
    • "cd ~/robot_ws/"
    • "catkin_make"
      • If your "joint-state-publisher-gui" couldn't found, you can solve this problem with "sudo apt install ros-melodic-joint-state-publisher-gui"
  5. Test.
    • Go to new terminal and write "roscore"
    • Then return the terminal you changed adn write "roslaunch robot_model_pkg robot.launch".
    • Now you will see RViz screen. Click "add" and select "robot model".
    • Change the fixed frames name from "map" to "base_link"
    • Then click "Save Configg as", go to "robot_model_pkg" and name it "robot.rviz"
    • "cd robot_model_pkg/"
    • "cd urdf/"
    • "gedit robot.urdf" You can find this file inside of the README.md
    • "roslaunch robot_model_pkg robot.launch"
    • Now you are able to control the green box from small GUI.

Xacro and URDF to Parametrize and Model Robots in RViz

  1. Go to a clean termianl and write "sudo apt-get install ros-melodic-rviz"
  2. Go to new terminal and start ros by "roscore"
  3. Go back to first terminal and run "rosrun rviz rviz"
  4. Installations.
    • "sudo apt-get install ros-melodic-urdf"
    • "sudo apt-get install ros-melodic-xacro"
    • "sudo apt-get install liburdfdom-tools"
  5. Create a workspace and catkin package
    • "mkdir -p ~/robot2_ws/src"
    • "cd ~/robot2_ws"
    • "catkin_make"
    • "source ~/robot2_ws/devel/setup.bash"
    • "echo $ROS_PACKAGE_PATH"
    • "cd ~/robot2_ws/src"
    • "catkin_create_pkg robot2_model_pkg roscpp tf2 geometry_msgs urdf rviz joint_state_publisher_gui xacro"
      • Dependencies
      • roscpp: Cpp and ROS
      • tf2: Lets the user keep track of multiple coordinate frames over time
      • geometry_msgs: Messages for common geometric primitives such as points, vectors, and poses.
      • urdf: C++ parser for URDF package
      • rviz: RVIZ
      • joint_state_publisher_gui:
      • xacro: XACRO
  6. Create the XACRO and Launch files.
    • "cd ~/robot2_ws/src/robot2_model_pkg/"
    • "mkdir urdf"
    • "mkdir launch"
    • "cd urdf"
    • "gedit material_color.xacro". You can find the content in related README.md
    • "gedit robot.xacro". You can find the content in related README.md Untitled
    • "cd ~/robot2_ws/src/robot2_model_pkg/launch"
    • "gedit robot_xacro.launch" You can find the content in README.md
    • Return the original workspace "cd ~/robot2_ws"
    • "catkin_make"
    • "roslaunch robot2_model_pkg robot_xacro.launch" (If you close the roscore we ran in step 2, go a new terminal an start before this line)
      • Add->Robot Model
      • Change the fixed frame name from "map" to "base_link"
      • Add "TF", now you can see objects names.

Model Robots in Gazebo From Scratch by Using URDF and Xacro

  1. Go to a terminal and write "gazebo". If not, you have to install Gazebo by properly installing ROS.
  2. Necessary Packages
    • "sudo apt-get install ros-melodic-gazebo-ros-pkgs"
    • "sudo apt-get install ros-melodic-gazebo-msgs"
    • "sudo apt-get install ros-melodic-gazebo-plugins"
    • "sudo apt-get install ros-melodic-gazebo-ros-control"
  3. Create a workspace and catkin package
    • "mkdir -p ~/robot3_ws/src"
    • "cd ~/robot3_ws"
    • "catkin_make"
    • "source ~/robot3_ws/devel/setup.bash"
    • "echo $ROS_PACKAGE_PATH"
    • "cd ~/robot3_ws/src"
    • "catkin_create_pkg robot_model3_pkg gazebo_msgs gazebo_plugins gazebo_ros gazebo_ros_control mastering_ros_robot_description_pkg"
      • Dependencies:
        • gazebo_msgs
        • gazebo_plugins
        • gazebo_ros
        • gazebo_ros_control
        • mastering_ros_robot_description_pkg
  4. Create the source files defining the robot geometry
    • "cd ~/robot3_ws/src/robot_model3_pkg"
    • "mkdir urdf"
    • "cd ~/robot3_ws/src/robot_model3_pkg/urdf"
    • "gedit robot.xacro" You can file the content in README.md
    • "gedit robot.gazebo" You can file the content in README.md
    • "cd .."
    • "mkdir launch"
    • "cd ~/robot3_ws/src/robot_model3_pkg/launch"
    • "gedit robot_xacro.launch" You can file the content in README.md Untitled
  5. Launch the model in Gazebo
    • "roslaunch robot_model_pkg robot_xacro.launch"

TurtleBot3 Robot in ROS and Simulate Movement in Gazebo

  1. Create the folder and clone the necessary TurtleBot3 files
  2. Create the workspace and specif the source
    • "catkin_make"
    • "source ~/test_turtlebot/devel/setup.bash"
  3. Simulate the robot motion in Gazebo
    • We have three robot opitons. Burger, Waffle, and Waffle Pi. Now we will select the "burger"
    • "export TURTLEBOT3_MODEL=burger"
  4. Launch the world
    • Empty World: "roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch"
    • Another World: "roslaunch turtlebot3_gazebo turtlebot3_world.launch"
    • Teleoperation Node:
      • Go to the new terminal
      • Specify the source "source ~/test_turtlebot/devel/setup.bash"
      • Specify the model "export TURTLEBOT3_MODEL=burger"
      • Launch the teleoperation node "roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch". Now w are able to control the robot.
  5. Final test
    • Go to new terminal "cd ~/test_turtlebot"
    • Specify the source "source ~/test_turtlebot/devel/setup.bash"
    • Specify the model "export TURTLEBOT3_MODEL=burger"
    • Launch the house "roslaunch turtlebot3_gazebo turtlebot3_house.launch"
    • Go to new terminal "cd ~/test_turtlebot"
    • Specify the source "source ~/test_turtlebot/devel/setup.bash"
    • Specify the model "export TURTLEBOT3_MODEL=burger"
    • Launch the teleoperation node "roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch". Now we are able to control the robot again.

Create URDF File and Model of Four Wheeled Mobile Robot in ROS

  1. Install RVIZ nececities
    • "sudo apt-get install ros-melodic-rviz"
    • "roscore"
    • "rosrun rviz rviz", if works continue.
  2. Install for URDF Modeling
    • "sudo apt-get install ros-melodic-urdf"
    • "sudo apt-get install liburdfdom-tools"
    • "sudo apt-get install ros-melodic-xacro"
  3. Create the workspace and catkin package
    • "mkdir -p ~/robot_dd/src"
    • "cd ~/robot_dd"
    • "catkin make"
    • "source ~/robot_dd/devel/setup.bash"
    • "echo $ROS_PACKAGE_PATH"
    • "cd ~/robot_dd/src"
    • Create the packages "catkin_create_pkg robot_dd_model_pkg roscpp tf2 geometry_msgs urdf rviz joint_state_publisher_gui"
      • Dependencies:
      • roscpp: CPP and ROS
      • tf2: Lets the user keep track of multiple frames over time
      • geometry_msgs: Messages for common geometric primitives such as points, vectors, and poses
      • urdf: C++ parser for UDF package
      • rviz: RVIZ
      • joint_state_publisher_gui: Contains a GUI tool for setting and publishing joint state values for a given URDF
  4. Create the URDF file and Launch file
    • "cd ~/robot_dd/src/robot_dd_model_pkg"
    • "mkdir urdf"
    • "mkdir launch"
    • "cd urdf"
    • "gedit robot.urdf" You can reach the code on README
    • "cd ~/robot_dd/src/robot_dd_model_pkg/launch"
    • "gedit robot.launch" You can reach the code on README
    • "cd ~/robot_dd"
    • "catkin_make" again Untitled
  5. Test
    • Open a new terminal
    • "roscore"
    • In original terminal, write "roslaunch robot_dd_model_pkg robot.launch"
    • Change the fixed frame name from "map" to "body_link" then add "RobotModel".
    • Too see the move you give from joint_state_publisher_gui, click add, then select the Axes make Axes' reference wheel any of them and try to change wheel1_joint value. You will see the difference in simulation.

Modelling, Simulation and Control of 4 Wheeled Robot in ROS and Gazebo

  1. Install necessary packages
    • Open a terminal and write "gazebo". If Gazebo don't open, install it properly by installing ROS.
    • Download these:
      • "sudo apt-get install ros-melodic-gazebo-ros-pkgs"
      • Provide the necessary interfaces to simulate a robot in Gazebo 3D rigid body simulator for robots. It integrates with ROS using ROS messages, services and dynamic reconfigure.
      • "sudo apt-get install ros-melodic-gazebo-msgs"
      • Messages and service data structures for interfacing ROS and Gazebo.
      • "sudo apt-get install ros-melodic-gazebo-plugins"
      • Robot independent Gazebo plugins for sensors, motor and dynamic reconfigurable components.
      • "sudo apt-get install ros-melodic-gazebo-ros-control"
      • Controllers to communicate between ROS and Gazebo.
      • "sudo apt-get install ros-melodic-teleop-twist-keyboard"
      • Package for controlling the robot by using keyboard keys.
  2. Create the Workspace and Catkin package.
    • "mkdir -p ~/robot_four/src"
    • "cd robot_four"
    • "catkin_make"
    • "source ~/robot_four/devel/setup.bash"
    • "echo $ROS_PACKAGE_PATH"
    • "cd ~/robot_four/src"
    • "catkin_create_pkg robot_model_pkg gazebo_msgs gazebo_plugins gazebo_ros gazebo_ros_control"
      • Dependencies:
      • "gazebo_msgs"
      • "gazebo_plugins"
      • "gazebo_ros"
      • "gazebo_ros_control"
  3. Create the source files defining robot geometry
    • "cd ~/robot_four/src/robot_model_pkg"
    • "mkdir urdf"
    • "cd ~/robot_four/src/robot_model_pkg/urdf"
    • Untitled
    • "gedit robot.xacro" You can find content in the related README file.
    • "gedit robot.gazebo" You can find content in the related README file.
  4. Create the launch file.
    • "cd ~/robot_four/src/robot_model_pkg"
    • "mkdir launch"
    • "cd ~/robot_four/src/robot_model_pkg/launch"
    • "gedit robot_xacro.launch" You can find content in the related README file.
    • "cd ~/robot_four"
    • "catkin_make"
  5. Launch the file.
    • Go to a new terminal, "roscore"
    • Return the terminal we working and "roslaunch robot_model_pkg robot_xacro.launch". Now we should see the model in the Gazebo.
    • Go to a new terminal, "rosrun teleop_twist_keyboard teleop_twist_keyboard.py"
  6. Controls
    • To investigate that are being used and published to. Go to new terminal and type:
      • "rostopic echo /odom"
      • "rostopic info /cmd_vel"

Modelling, Simulation and Control of 2 Wheeled Robot in ROS and Gazebo

  1. Install necessary packages
    • "sudo apt-get install ros-melodic-gazebo-ros-pkgs"
    • "sudo apt-get install ros-melodic-gazebo-msgs"
    • "sudo apt-get install ros-melodic-gazebo-plugins"
    • "sudo apt-get install ros-melodic-gazebo-ros-control"
    • "sudo apt-get install ros-melodic-teleop-twist-keyboard"
  2. Create the Workspace and Catkin package.
    • "mkdir -p ~/robot_two_wheeled/src"
    • "cd robot_two_wheeled"
    • "catkin_make"
    • "source ~/robot_two_wheeled/devel/setup.bash"
    • "echo $ROS_PACKAGE_PATH"
    • "cd ~/robot_two_wheeled/src"
    • "catkin_create_pkg robot_model_pkg gazebo_msgs gazebo_plugins gazebo_ros gazebo_ros_control"
      • Dependencies:
      • "gazebo_msgs"
      • "gazebo_plugins"
      • "gazebo_ros"
      • "gazebo_ros_control"
  3. Create the source files defining robot geometry
    • "cd ~/robot_two_wheeled/src/robot_model_pkg"
    • "mkdir urdf"
    • "cd ~/robot_two_wheeled/src/robot_model_pkg/urdf"
    • "gedit robot.xacro" You can find content in the related README file.
    • "gedit robot.gazebo" You can find content in the related README file.
  4. Create the launch file.
    • "cd ~/robot_two_wheeled/src/robot_model_pkg"
    • "mkdir launch"
    • "cd ~/robot_two_wheeled/src/robot_model_pkg/launch"
    • "gedit robot_xacro.launch" You can find content in the related README file.
    • "cd ~/robot_two_wheeled"
    • "catkin_make"
  5. Launch the file.
    • Go to a new terminal, "roscore"
    • Return the terminal we working and "roslaunch robot_model_pkg robot_xacro.launch". Now we should see the model in the Gazebo.
    • Go to a new terminal, "rosrun teleop_twist_keyboard teleop_twist_keyboard.py"
  6. Controls
    • To investigate that are being used and published to. Go to new terminal and type:
      • "rostopic echo /odom"
      • "rostopic info /cmd_vel"

robot-modelling's People

Contributors

berattezer avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.