ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to move my robot

asked 2020-10-14 15:22:34 -0600

Manulobo gravatar image

Hello to all,

I am using rtabmap and kinect 360. I also have a Ylidar. Everything works perfectly and I am seeing it in rviz.

My doubt is how to make ROS move my robot based on the obstacles that are in the map. I have a TB6612FNG engine, I have everything connected, but I don't understand how to make it move. How do I tell ROS where the engine pins are so that it can move it automatically?

I'm using ROS Melodic.

Thank you very much.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2020-10-17 20:12:20 -0600

matlabbe gravatar image

For rtabmap_ros integration with move_base, see http://wiki.ros.org/rtabmap_ros/Tutor....

For an example with Turtlebot3 on melodic in simulation, see http://wiki.ros.org/rtabmap_ros/Tutor....

To setup move_base's costmaps and planners, see http://wiki.ros.org/navigation/Tutori....

edit flag offensive delete link more
0

answered 2020-10-15 02:45:02 -0600

RobertZickler gravatar image

Hey,

to get the obstacles in MoveIt (octomap) from rtabmap, you have to write a script that subscribes to the rtabmap-octomap

rospy.Subscriber('octomap_binary', Octomap, your_callback, queue_size=1)

and publish this into move_group/monitored_planning_scene

rospy.Publisher('move_group/monitored_planning_scene', PlanningScene, queue_size=1)

Full script:

#! /usr/bin/env python

import rospy
from octomap_msgs.msg import Octomap
from moveit_msgs.msg import PlanningScene, PlanningSceneWorld, CollisionObject

frame_id = 'map'
rospy.init_node('moveit_octomap_handler')
pub_octo = rospy.Publisher('move_group/monitored_planning_scene', PlanningScene, queue_size=10)
pub2 = rospy.Publisher('/planning_scene', PlanningScene, queue_size=10)
psw = PlanningSceneWorld()
psw.octomap.header.stamp = rospy.Time.now()
psw.octomap.header.frame_id = frame_id
psw.octomap.origin.position.x = 0
psw.octomap.origin.orientation.w = 1
ps = PlanningScene()


def cb(msg):
    col_obj = CollisionObject()
    col_obj.header.frame_id = frame_id

    psw.collision_objects.append(col_obj)
    psw.octomap.octomap = msg
    ps.world.collision_objects.append(col_obj)
    ps.world = psw
    ps.is_diff = True
    pub_octo.publish(ps)
    pub2.publish(ps)


if __name__ == '__main__':
    print("Starte die Uebertragung von Rtabmap-Octomap in die Pfadplanung")
    rospy.Subscriber('octomap_binary', Octomap, cb, queue_size=1)  # octomap_full
    rospy.spin()

This works for me but there is probably a more elegant way.

Robert

edit flag offensive delete link more

Comments

Are you confusing move_group and move_base perhaps?

gvdhoorn gravatar image gvdhoorn  ( 2020-10-15 03:05:40 -0600 )edit

When you look here (MoveIt System Architecture) you see that move_group is getting the planning_scene from the Occupancy Map

RobertZickler gravatar image RobertZickler  ( 2020-10-15 03:28:12 -0600 )edit

The OP has base_move as a tag, which I believe should have been move_base. That's from the navigation stack.

rtabmap is often also used with navigation, as are lidars.

TB6612FNG is a "dual motor driver carrier", probably used to drive motors for a differential drive platform.

That was what I was asking: move_group is MoveIt, move_base is Navigation stack.

gvdhoorn gravatar image gvdhoorn  ( 2020-10-15 03:33:19 -0600 )edit

My apology, you are absolutely right. My answer is therfore unnecessary. I completely missunderstood the question.

RobertZickler gravatar image RobertZickler  ( 2020-10-15 03:46:15 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-10-14 15:22:34 -0600

Seen: 379 times

Last updated: Oct 17 '20