Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions

Question

The nature and importance of the global marketplace.

Answered: 1 week ago