Question: Submission: Your source code - entire your package folder ( exclude other folders besides root src ) Example Folder Structures homework _ ws src package

Submission:
Your source code - entire your package folder (exclude other folders besides root src)
Example Folder Structures
homework_ws
src
package_1
package_2
Screen recording (video) of how everything runs and show some example input
Submission format: ( format violation will cause some point penalty )
Filename : hw04_yourname.zip
Details
Create simple calculator base on ROS2 Services and Topic based communication
Requirement:
The calculator will have 4 type of operation,
Plus
Minus
Divide
Multiply
Create a Node that allow user to input their name send 2 numbers and operator as input through terminal (Both Service Client and Publisher will be in one single script)
Example Input:
ros2 run calculator_demo calculator_client "Shawn" 23"/"
Service Client:
Send 2 numbers, current system time and operator
Publisher:
Send username through /username topic
Create a Node that holds the core logic of the calculator operation listed above. (Both Service Server and Subscriber will be in one single script)
Example Output:
[Shawn][Current Time: 07:41:19][Displaied Decimal: 3]: Received a Input 2/3 that sent at 07:41:10. The calculation result is: 0.666
Service Server:
Receive:
The 2 number input, sender`s system time, operator
Return:
Current system time
Subscriber:
Receive username
Create a ros2 parameters called decimal that controls how many decimal will be printed in the output (Think about where do you need to put it)
Example Input ros2 param set /calculator_demo decimal 3
this will make 2/3=0.666
Example Input ros2 param set /calculator_demo decimal 5
this will make 2/3=0.66666
Hints:
You will need to create your custom service message

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!