Custom ROS package to run Planning/Learning Experiments with Locobot Robot in Simulation and Real World. Built for ROS Noetic. Tested in Ubuntu 20.04 & Python = 3.8.10
roslaunch locobot_custom nav_moveit.launch
Note: The RTABmap is located in ~/.ros/rtabmap
.
Run
rosrun locobot_custom obtain_obj_loc.py <obj_name>
to obtain and print the location of the objects. If no object name is specified, the list of available objects' names will be printed.
The main code component is the LBMoveIt
class, which automatically
registers the move group and allows you to move it to a joint
state or a pose goal. For more example, please see the official
example code from
[interbotix_ros_toolboxes/interbotix_common_toolbox/interbotix_moveit_interface/scripts/moveit_python_interface]
. Link
To directly run the test code and script, do:
ROS_NAMESPACE=locobot rosrun locobot_custom universal_move_arm.py <args>
The script also includes three different test functions. If you run the script directly, you may specify <args>
depending on which test function you want to run:
main
function tries to get the pickup pose using the code inobtain_pick_item_pose.py
and moves the arm to the item. Run the script without args to run this function.test1
function tries to move the arm to a specific location, which can be helpful for debugging. Run the script with argument "test" to run this function.print_pose
function prints the current pose of the arm, which could also be helpful for debugging when for example we manually set the arm to a specific angle and we want to see what pose the arm is at. Run the script with argument get_pose to run this function.
Run
rosrun locobot_custom obtain_pick_item_pose.py
to obtain the pickup pose for the cricket ball in the scene. Feel free to change the name of the object in the script located in the debug func.
It start running and will continuously print the pickup pose in the terminal. It will also publish the pickup pose
plus the location of the object to /locobot/estimated_pickup_pose
and
/debug/obj_loc
to aid visualization and debugging in rviz.
In Rviz load the custom configuration file named pickup_visualize.rviz
to get the topic loaded.
If you want to build a new map:
roslaunch locobot_custom nav_moveit.launch localization:=false rtabmap_args:=-d
Or if you want to use a stored map and run localization:
roslaunch locobot_custom nav_moveit.launch localization:=true
Note: The RTABmap is located in ~/.ros/rtabmap
on the on-board NUC computer.
Firstly, make sure ROS_IP and ROS_MASTER_URI is correctly set:
export ROS_IP=<your desktop computer IP>
export ROS_MASTER_URI=http://locobot.local:11311
rosrun locobot_custom move_base_loco.py <objects>
objects: table, doorway_facing_green, doorway_facing_blue, large_sofa, small_sofa, bin
rosrun locobot_custom obtain_nav_goals.py
roslaunch interbotix_xslocobot_perception xslocobot_perception.launch robot_model:=locobot_wx200
roscd locobot_custom
cd scripts
python3 pick_place_no_armtag.py
It will then pickup every detected object in the camera view, raise it up a few inches, and drop it.
roslaunch locobot_custom nav_moveit_perception.launch
If you see this issue:
Lookup would require extrapolation ... into the future.
Then this is an issue of the main NUC computer and the Create 3 base (it has its own computer) out of sync. It might happen when the robot has not been on for a while and is just booted up. Normally it should sync itself after a few seconds. If time synchronization fail to happen, consult the troubleshoot page here.
If the arm collided with some item while moving and red indicator light of one or more of the joints are flashing, first hold the arm and turn off the ros node. Put it back to its sleep position, then unplug the 12V connection from the large powerbank and plug it in again after waiting 5 seconds. It should work again after this reset.
If the robot cannot find Dynamixel ID of some of the motors, it could be that the robot was in a position that probably broke one of the wires. It could also be that one of the servo motors on the arm is malfunctioning. To solve the problem, run the Dynamixel Wizard 2 diagnosis tool, and see if the motors can be detected. The Tufts locobot alreadu have it installed at /home/locobot/ROBOTIS/DynamixelWizard2/DynamixelWizard2.sh
. Run this command and a window will pop up, allowing you to test connections to the motors.
For more debugging help or other issues, see the official documentation here