Robotics StackExchange | Archived questions

Trying to navigate turtlebot3 burger in unexplored environments

I'm trying to figure out what I can't set way points on unexplored environments while SLAM is on.In the Rviz, when I click the map with "2D Nav Goal", nothing happens, even on the parts of the map that SLAM has discovered. Is there a parameter in one of the turtlebot3 config files I have to set?

My test code also doesnt work either. Am I subscribing to the wrong things? What I'm trying to do must be possible.

#/usr/bin/python2.7
import rospy
import math
from move_base_msgs.msg import MoveBaseActionGoal
from geometry_msgs.msg import PoseStamped
from nav_msgs.msg import Odometry
from nav_msgs.msg import OccupancyGrid
from nav_msgs.msg import Path

goal= PoseStamped()
goal.header.stamp = rospy.get_rostime()
goal.header.frame_id = 'map'
goal.pose.position.x = 1.203
goal.pose.position.y = -0.4769
goal.pose.position.z = 0

goal.pose.orientation.x = 0
goal.pose.orientation.y = 0
goal.pose.orientation.z = 0
goal.pose.orientation.w = 1

def callback(msg):
    pass

rospy.init_node("control")
pub = rospy.Publisher("goal", PoseStamped, queue_size=1, latch=True)
rospy.Subscriber("/odom", Odometry, callback)

while not rospy.is_shutdown():
    pub.publish(goal)
    rospy.sleep(10.5)
    goal.pose.position.x = 0.203
    goal.pose.position.y = -0.4769
    pub.publish(goal)
    rospy.sleep(10.5)

My launch file I use to run this code:

<launch>
    <node pkg="action_practice" type="tester.py" name="control"    ns="move_base_simple" output="screen"/>
</launch>

Asked by distro on 2022-07-21 05:12:22 UTC

Comments

Answers