The task is about implementation of the designed World Model using C++ code. The program written ,described as a node is used to display the values of position and orientation of robot joints in addition to World Model program implementation which include other classes and objects. The program is connected with Rviz motion planner and to Gazebo simulator by launching a launch file which launches the Rviz \footnote{http://wiki.ros.org/rviz/UserGuide} and Gazebo \footnote{http://gazebosim.org/} and the node file \footnote{https://git-st.inf.tu-dresden.de/nikaviator/zero/-/blob/master/src/\lstinline|robot_models_node.cpp|}. The Robot can be manipulated using a motion plan in Rviz and then plan can be used to run the simulation in Gazebo Simulator.\\
The task is about implementation of the designed World Model using C++ code. The program written ,described as a node is used to display the values of position and orientation of robot joints in addition to World Model program implementation which include other classes and objects. The program is connected with Rviz motion planner and to Gazebo simulator by launching a launch file which launches the Rviz \footnote{http://wiki.ros.org/rviz/UserGuide} and Gazebo \footnote{http://gazebosim.org/} and the node file \footnote{https://git-st.inf.tu-dresden.de/nikaviator/zero/-/blob/master/src/\lstinline|robot_models_node.cpp|}. The Robot can be manipulated using a motion plan in Rviz and then plan can be used to run the simulation in Gazebo Simulator.\\
The program code is designed to take values from the robot in Gazebo Simulator and display them in output.The program also builds the object structure by initializing values and assigning them values.Every class designed is connected to the node program using the header files and contain variables that are used to build object structure in the main node program.So after launching the Rviz and Gazebo using launch file ,the program is built and run and thus displays the position and orientation values of robot joints.\\
The program code is designed to take values from the robot in Gazebo Simulator and display them in output.The program also builds the object structure by initializing values and assigning them values.Every class designed is connected to the node program using the header files and contain variables that are used to build object structure in the main node program.So after launching the Rviz and Gazebo using launch file ,the program is built and run and thus displays the position and orientation values of robot joints.\\
...
@@ -19,10 +20,10 @@ The tools used for implementation stage in the task are -
...
@@ -19,10 +20,10 @@ The tools used for implementation stage in the task are -
This is the editor used to write C++ code for a project in this case task and compile and run it. It provides many aides to help reduce the programmers workload and automate the process by providing many suggestions using inbuilt libraries and pointing out logic errors in advance and helps mitigates errors and warnings that may come at a later stage.It can be started by clicking on the icon but it is recommended to start this from terminal by typing "CLion".The following figure shows how CLion IDE looks like and also talks about some of its features.\\
This is the editor used to write C++ code for a project in this case task and compile and run it. It provides many aides to help reduce the programmers workload and automate the process by providing many suggestions using inbuilt libraries and pointing out logic errors in advance and helps mitigates errors and warnings that may come at a later stage.It can be started by clicking on the icon but it is recommended to start this from terminal by typing "CLion".The following figure shows how CLion IDE looks like and also talks about some of its features.\\
\begin{figure}
\begin{figure}
\centering
\centering
\includegraphics[width=1.0\linewidth]{"../../Screenshot from 2020-10-14 04-08-02"}
\includegraphics[width=1.0\linewidth]{"../../Screenshot from 2020-10-14 04-08-02"}
\caption{CLion Screenshot}
\caption{CLion Screenshot}
\label{fig:screenshot-from-2020-10-14-04-08-02}
\label{fig:screenshot-from-2020-10-14-04-08-02}
\end{figure}
\end{figure}
Fig.6.1 On the left side the file structure is shown. On right side the files opened are shown under each tab. On the left the class files are visible for 11 classes under src folder and at bottom in this structure there is CMakeLists.txt file visible which is also used in this case to help set the configuration for executables. In the src folder there also exist file \lstinline|robot_models_node.cpp| visible below the .gitkeep statement. Above src folder there also exist a launch folder containing launcher.launch file in red . This contains launch commands to launch rviz , gazebo and the node file.
Fig.6.1 On the left side the file structure is shown. On right side the files opened are shown under each tab. On the left the class files are visible for 11 classes under src folder and at bottom in this structure there is CMakeLists.txt file visible which is also used in this case to help set the configuration for executables. In the src folder there also exist file \lstinline|robot_models_node.cpp| visible below the .gitkeep statement. Above src folder there also exist a launch folder containing launcher.launch file in red . This contains launch commands to launch rviz , gazebo and the node file.
...
@@ -34,10 +35,10 @@ Fig.6.1 On the left side the file structure is shown. On right side the files op
...
@@ -34,10 +35,10 @@ Fig.6.1 On the left side the file structure is shown. On right side the files op
This is Motion Planner used to plan the motion of robot Franka Panda. This connects to simulator for running real world simulations using the Robot Operating System (ROS) and launch file.Above is screenshot for Rviz.\\
This is Motion Planner used to plan the motion of robot Franka Panda. This connects to simulator for running real world simulations using the Robot Operating System (ROS) and launch file.Above is screenshot for Rviz.\\
\begin{figure}
\begin{figure}
\centering
\centering
\includegraphics[width=1.0\linewidth]{"../../Screenshot from 2020-10-14 04-13-00"}
\includegraphics[width=1.0\linewidth]{"../../Screenshot from 2020-10-14 04-13-00"}
\caption{MoveIT / RVIZ Screenshot}
\caption{MoveIT / RVIZ Screenshot}
\label{fig:screenshot-from-2020-10-14-04-13-00}
\label{fig:screenshot-from-2020-10-14-04-13-00}
\end{figure}
\end{figure}
...
@@ -52,10 +53,10 @@ When starting RVIZ for first time there is an empty world and then Add button ne
...
@@ -52,10 +53,10 @@ When starting RVIZ for first time there is an empty world and then Add button ne
This is real world simulator which simulates robot motion with real world parameters tuned to check if the motion plan is executable and feasible in real world.This also provide values to program using listener tf buffer in the node program but this is explained in detail later.Below is a figure showing Gazebo simulator.\\
This is real world simulator which simulates robot motion with real world parameters tuned to check if the motion plan is executable and feasible in real world.This also provide values to program using listener tf buffer in the node program but this is explained in detail later.Below is a figure showing Gazebo simulator.\\
\begin{figure}
\begin{figure}
\centering
\centering
\includegraphics[width=1.0\linewidth]{"../../Screenshot from 2020-10-14 04-13-12"}
\includegraphics[width=1.0\linewidth]{"../../Screenshot from 2020-10-14 04-13-12"}
\caption{Gazebo Screenshot}
\caption{Gazebo Screenshot}
\label{fig:screenshot-from-2020-10-14-04-13-12}
\label{fig:screenshot-from-2020-10-14-04-13-12}
\end{figure}
\end{figure}
In this task there was no need to explore functionality or fiddle any of features in Gazebo. It was used to visualize motion plan of Rviz-MoveIt and seen if this is real world feasible in Gazebo. In this tool it is possible to tune a lot of real world parameters and the ones related to Robot Panda are torques on joints
In this task there was no need to explore functionality or fiddle any of features in Gazebo. It was used to visualize motion plan of Rviz-MoveIt and seen if this is real world feasible in Gazebo. In this tool it is possible to tune a lot of real world parameters and the ones related to Robot Panda are torques on joints
...
@@ -65,10 +66,10 @@ To upload code as package to a central repository. This is a widely used reposit
...
@@ -65,10 +66,10 @@ To upload code as package to a central repository. This is a widely used reposit
It shows the projects available under the namespace . They can be clicked to view files structure under one particular project.
It shows the projects available under the namespace . They can be clicked to view files structure under one particular project.
\begin{figure}
\begin{figure}
\centering
\centering
\includegraphics[width=1.0\linewidth]{"../Screenshot from 2020-10-14 20-16-28"}
\includegraphics[width=1.0\linewidth]{"../Screenshot from 2020-10-14 20-16-28"}
\caption{Gitlab Screenshot}
\caption{Gitlab Screenshot}
\label{fig:screenshot-from-2020-10-14-20-16-28}
\label{fig:screenshot-from-2020-10-14-20-16-28}
\end{figure}
\end{figure}
\newpage
\newpage
...
@@ -83,7 +84,7 @@ The following paragraphs describe the modules of the program used in implementat
...
@@ -83,7 +84,7 @@ The following paragraphs describe the modules of the program used in implementat
\lstset{language=C++}
\lstset{language=C++}
\lstset{
\lstset{
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
}
}
\begin{lstlisting}
\begin{lstlisting}
int main(int argc, char** argv) {
int main(int argc, char** argv) {
...
@@ -98,7 +99,7 @@ Here the main function is defined and the ROS node defined and initialized. Also
...
@@ -98,7 +99,7 @@ Here the main function is defined and the ROS node defined and initialized. Also
\lstset{language=C++}
\lstset{language=C++}
\lstset{
\lstset{
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
}
}
\begin{lstlisting}
\begin{lstlisting}
abstractobject o1;
abstractobject o1;
...
@@ -119,37 +120,37 @@ Here objects are defined which are later used to input values into variables def
...
@@ -119,37 +120,37 @@ Here objects are defined which are later used to input values into variables def
\lstset{language=C++}
\lstset{language=C++}
\lstset{
\lstset{
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
}
}
\begin{lstlisting}
\begin{lstlisting}
o9.c->robname="Robot FPE";
o9.c->robname="Robot FPE";
o9.c->of=true;
o9.c->of=true;
o9.c->moving=false;
o9.c->moving=false;
\end{lstlisting}
\end{lstlisting}
This is an example of defining values to the variables in the classes included as header files inside the main program.In many cases pointers are used because they are useful to implement association and aggregation functionalities to program which are imperative.\\
This is an example of defining values to the variables in the classes included as header files inside the main program.In many cases pointers are used because they are useful to implement association and aggregation functionalities to program which are imperative.\\
Association is used where classes are together related by a relation which is not inheritance but only associated to each other because they use each other's values.In this case the class quaternion is associated to worldobject class by association relation which is implemented by including the associated class quaternion.h as header file.\\
Association is used where classes are together related by a relation which is not inheritance but only associated to each other because they use each other's values.In this case the class quaternion is associated to worldobject class by association relation which is implemented by including the associated class quaternion.h as header file.\\
Aggregation is used where a class if do not exist must not let its child classes be instantiated and used.
Aggregation is used where a class if do not exist must not let its child classes be instantiated and used.
In this case world class is in aggregation relation to abstract object class which have child classes as Grasp Object and Obstacle class.So if the world class were not to exist the Grasp Object and Obstacle Class cannot be initialized or used.
In this case world class is in aggregation relation to abstract object class which have child classes as Grasp Object and Obstacle class.So if the world class were not to exist the Grasp Object and Obstacle Class cannot be initialized or used.
So pointers are used to take input values for child classes using pointer variables of world class.
So pointers are used to take input values for child classes using pointer variables of world class.
\lstset{language=C++}
\lstset{language=C++}
\lstset{
\lstset{
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
basicstyle=\fontsize{11}{11}\selectfont\ttfamily
}
}
\begin{lstlisting}
\begin{lstlisting}
tf2ros::Buffer tfBuffer;
tf2ros::Buffer tfBuffer;
tf2ros::TransformListener tfListener(tfBuffer);
tf2ros::TransformListener tfListener(tfBuffer);
\end{lstlisting}
\end{lstlisting}
tf2 is used to listen to values of variables and hence a buffer is allocated and used. After this a listener object is defined for tf2 which will be later used to listen the values and use them in program.
tf2 is used to listen to values of variables and hence a buffer is allocated and used. After this a listener object is defined for tf2 which will be later used to listen the values and use them in program.
A try catch block is used to compare and connect the attribute of robot for which we seek values i.e. in this case joint 1...7 ,relative to standard world and store them in the defined objects transformStamped1,2,3....\\
A try catch block is used to compare and connect the attribute of robot for which we seek values i.e. in this case joint 1...7 ,relative to standard world and store them in the defined objects transformStamped1,2,3....\\
Then exceptions are caught and some statements defined for this .This is in case some things don't work.
Then exceptions are caught and some statements defined for this .This is in case some things don't work.
Here in these steps the object variables take input the objects values from listener object transformStamped and store them in the node program and which then outputs these values.All the static variable defined in the program are initialized with 0 value before using them.\\
Here in these steps the object variables take input the objects values from listener object transformStamped and store them in the node program and which then outputs these values.All the static variable defined in the program are initialized with 0 value before using them.\\
This program thus listens to values from simulation and displays using appropriate output statements. The robot in Gazebo is thus connected to Rviz motion planner using ROS which enables the node program \lstinline|robot_models_node.cpp|, to listen to desired values in this case position and orientation of joints .
This program thus listens to values from simulation and displays using appropriate output statements. The robot in Gazebo is thus connected to Rviz motion planner using ROS which enables the node program \lstinline|robot_models_node.cpp|, to listen to desired values in this case position and orientation of joints .