Skip to content

Latest commit

 

History

History
95 lines (67 loc) · 1.34 KB

server_and_client.md

File metadata and controls

95 lines (67 loc) · 1.34 KB

Client Server Python Implementation


Server creation

Open a terminal inside scripts folder and create a file name server.py. Copy the content from server.txt and paste. Open a terminal in the same location and Run

chmod +x server.py

to enable execute permission.


Client creation

Open a terminal inside scripts folder and create a file name client.py. Copy the content from client.txt and paste. Open a terminal in the same location and Run

chmod +x client.py

to enable execute permission.


CMakeLists.txt file modifications

Open lab_2_3dPose/CMakeLists.txt and add following lines to the bottom of the file.

catkin_install_python(PROGRAMS scripts/client.py scripts/server.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

Build the code

Go to root of the workspace

cd ~/robotics/
catkin build

or

catkin_make

Run the server

Go to root of the workspace and run

roscore

Run the server

Go to root of the workspace and on a new terminal

cd ~/robotics/
source devel/setup.bash

or

rosrun lab_2_3dPose server.py

Run the client

Go to root of the workspace and on a new terminal

cd ~/robotics/
source devel/setup.bash

or

rosrun lab_2_3dPose client.py

<< Back to Main menu