.
What will you learn in this post
- Learn how to launch the Vector simulation and how to launch a Red Ball tracking node using ROS and the
package created by BetaB0t Vector_ROS
List of resources used in this post
- The ROSject with the simulation and code Plug and Play:
http://www.rosject.io/l/908ce19/ - A live version of this post on YouTube: https://youtu.be/z7bo1nyjhYM
- Git from BetaB0t for Vector_ROS Package: https://github.com/betab0t/vector_ros
More resources (for real robot)
- Video Of Real Robot doing the exact same thing: https://www.youtube.com/watch?v=XxaOyA-M3U4
- Git of Vector and Cozmo Simulation: https://bitbucket.org/theconstructcore/cozmo_simulation/src/master/
- Install SDK in ALL OS: https://developer.anki.com/vector/docs/initial.html
- VECTOR API: https://developer.anki.com/vector/docs/api.html
- Setup script for Vector in Local computer:
https://bitbucket.org/theconstructcore/morpheus_chair/src/master/vector_scripts/01_how_to_setup_vector_sdk.py - Here you can find the list of materials that you will need for this session in case you have a real robot:
Vector Robot: https://www.amazon.es/Anki-000-0079-Vector/dp/B078T42JCM
Vector Robot Playing Space ( recommended to avoid any problems with flying Vectors :P): https://www.amazon.es/Anki-000-0078-Habitat-Vector-Space/dp/B07G3QSX8G
Launching COZMO and VECTOR simulations
If you click in the ROSject provided above (http://www.rosject.io/l/908ce19/), you will get a copy of it on ROSDS (ROS Development Studio)
To launch it, you first need to open the ROSject clicking on the Open button.
Once the ROSject open, you just launch the simulation by clicking Simulations–>Select Launch File, then you select cozmo_gazebo main_cozmo.launch
If everything went ok, now you should have the simulation up and running:
You can launch cozmo and vector just by choosing between the main_vector.launch and main_cozmo.launch
You can access the camera, the forklift, the wheels (through the /cmd_vel ROS Topic), imu and the Infra-Red sensors form their corresponding topics. All the topics have the exact same name in the two different robots, except that you have to change the word vector for cozmo.
Launching the Simple Red Ball tracking
Then open a Webshell from the Tools Bar (Tools -> Shell), and execute the following commands:
roslaunch vector_ros simple_ball_tracker.launch is_simulation:=true
You should then Open the Graphical Tools from the Tools menu to see the RedBall detection Gui:
You should then be able to see the robot camera:
If you now move the ball around with the move object icon of the 3D view, you can see how Vector follows the ball. You can also move the ball with the keyboard, which will send absolute position commands to the ball. You first need to run the launch file below:
roslaunch cozmo_gazebo move_redball.launch
Then use the Keys below:
“i“=+X Axis,
“k“=STOP,
“j“=-Y Axis,
“l“=+Y Axis,
“,“=-X Axis:
Moving the robot around
With the ball tracking enabled, you can move the robot around using the command below in the web shell:
rosrun teleop_twist_keyboard teleop_twist_keyboard.py
Reccomended values:
turn = 5.55991731349
speed = 0.1937102445
Seeing the camera
In order to see the camera in the Graphical Tools, you can run rqt_image_view through the webshell using the command below:
rosrun rqt_image_view rqt_image_view
Now open the Graphical Interface as explained earlier by clicking Tools -> Graphical Tools.
Moving FORK and Head
Before publishing the positions of the fork, it is worth mentioning that the fork range is [0.0,-0.8]
Now, let’s go ahead and move it with the command below:
rostopic pub /vector/lift_height/command std_msgs/Floa4 "data: -0.8"
Now, to move the head we use the commands below. Also, important to note that the range of the head is [0.1,-0.57]
Let’s then move the head:
rostopic pub /vector/head_angle/command std_msgs/Float64 "data: -0.57"
Where is the IMU
rostopic echo /imu
Current known issues
We noticed that there is a drift that occurs when Vector or Cozmo is still.
SPECIAL THANKS:
Our special thanks to beat_b0t for creating the Vector_ROS package.
Also, thanks to TheConstructSim For creating the COZMO and Vector simulation package. and thanks to ANKI for creating COZMO and VECTOR real robots that we can use to play around and learn more about robotics.
Youtube Video
We hope you like the post. If you prefer, we also have a live version of this post in YouTube. You can find it in the link below. If you like it, please consider subscribing to our channel on youTube. We are constantly adding new ROS-related content.
———————————————————————————
Music:
Original Track:https://youtu.be/FBv6rm1lY0w
Thanks to NewRetroWave for letting us use their music.
Here more info:
New Retro Wave + Bachelor of Hearts Aurora Borealis
Smooth vibes for you retro soul. Listen and enjoy.
OUT NOW on NRW Records:
https://newretrowave.bandcamp.com/album/a-cosmic-funk-odyssey-ep
iTunes: http://apple.co/2r6N1T7
Support:
https://www.facebook.com/BachelorOfHeartsmusic/
Artwork provided by Murryous, who is our featured artist for May. Please support him:
https://www.instagram.com/murryous/
———————————————————————————
3D Models:
Orange Robot:
https://www.blendswap.com/blends/view/77718
Sphere Robot:
https://www.blendswap.com/blends/view/80818
Robot Parts:
https://www.blendswap.com/blends/view/78357
Mars Lander:
https://www.blendswap.com/blends/view/81264
#Vector #COZMO #ANKI #ROS
0 Comments