#MasteringROS 2020 Spring | Day 3

preview_player
Показать описание

In the DAY3 we created the map of the environment and make the RB-KAIROS robot autonomously navigate in an indoor environment.

We will repeat this course again in April. Stay tuned!
--

#ROS #Robot #ROStutorials #Mapping #RobotNavigation #Robotics
Рекомендации по теме
Комментарии
Автор

hello sir can we get a detailed video on how to install and use rqt_gui for ros //???

rahulmishra
Автор

While running this I got some error, it's not taking operators such as +, *, - etc via command line, can you please help me in this



#!/usr/bin/env python

import rospy
from rospy_tutorials.msg import Floats

def add(x, y):
return x + y
# This function subtracts two numbers
def subtract(x, y):
return x - y

# This function multiplies two numbers
def multiply(x, y):
return x * y

# This function divides two numbers
def divide(x, y):
return x / y

def publishMethod(Float_f, Float_s):
pub = rospy.Publisher('talker', Floats, queue_size=10)
rospy.init_node('publish_node', anonymous=True)
rate = rospy.Rate(1)
while not rospy.is_shutdown():
Float_f = input('Enter first number ')
Float_s = input('Enter second number ')

rospy.loginfo("Data is being sent")
print("Select operation.")
print("1.Add")
print("2.Subtract")
print("3.Multiply")
print("4.Divide")
while True:
# Take input from the user
choice = input("Enter choice(1/2/3/4): ")

# Check if choice is one of the four options
if choice in ('1', '2', '3', '4'):
Float_f = float(input("Enter first number: "))
Float_s = float(input("Enter second number: "))

if choice == '1':
print(Float_f, "+", Float_s, "=", add(Float_f, Float_s))

elif choice == '2':
print(Float_f, "-", Float_s, "=", subtract(Float_f, Float_s))

elif choice == '3':
print(Float_f, "*", Float_s, "=", multiply(Float_f, Float_s))

elif choice == '4':
print(Float_f, "/", Float_s, "=", divide(Float_f, Float_s))
break
else:
print("Invalid Input")



pub.publish(publishString4)
rate.sleep()

if __name__ == '__main__':
try:
publishMethod()
except rospy.ROSInterruptException:
pass

aaqibalone