Skip to content

About the configuration of waypoints_nav program #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ju-mingyue opened this issue Nov 25, 2021 · 2 comments
Open

About the configuration of waypoints_nav program #78

ju-mingyue opened this issue Nov 25, 2021 · 2 comments

Comments

@ju-mingyue
Copy link

ju-mingyue commented Nov 25, 2021

@DaikiMaekawa Hello,Mr. DaikiMaekawa, after running the waypoints_nav program, do I still need to run move_base?
深度截图_选择区域_20211125154220

At the same time, I use the handle to control the robot to build the map, so how do I need to modify my handle program to match this package? Below is my handle program and launch file:

`
#!/usr/bin/python
#coding=utf-8
import time
import rospy
from sensor_msgs.msg import Joy
from geometry_msgs.msg import Twist
class Joy360:
def init(self):
self.__line_x = 0
self.__angle_z = 0
self.__pub_cmd_vel = None #:
self.__pub_can_vel = None
self.__start = False
rospy.init_node("joy")
rospy.Subscriber("joy",Joy,self.joy_callback)
#self.__pub_cmd_vel = rospy.Publisher("/cmd_vel",Twist,queue_size=100)
self.__pub_cmd_vel = rospy.Publisher("/joy/cmd_vel",Twist,queue_size=100)

def joy_callback(self,data):
    if data.buttons[10] == 1:
        self.__start = not self.__start
    self.__line_x = data.axes[1]*0.3
    self.__angle_z = data.axes[3]*0.3

def start(self):
    rospy.loginfo("init node ok!!")
    try:
        while not rospy.is_shutdown():
            #time.sleep(0.01)
            cmd= Twist()
            cmd.linear.x=self.__line_x
            cmd.angular.z=self.__angle_z
            if self.__start:
               self.__pub_cmd_vel.publish(cmd)
    except KeyboardInterrupt as e:
         rospy.loginfo("quit by user " + str(e))

if name=="main":
joy_ins = Joy360()
joy_ins.start()`

深度截图_选择区域_20211125155229

@DaikiMaekawa
Copy link
Member

@ju-mingyue Yep, you need to run move_base as waypoints_nav internally calls it unless your robot's system already provides a compatible interface.

@ju-mingyue
Copy link
Author

ju-mingyue commented Nov 25, 2021

@DaikiMaekawa Hello, how does my controller post topics to the waypoints_saver file? Do I need to post a topic of handle buttons in the program?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants