This repo contains 2 independent projects:
This package contains files that control the turtlebot's speed and direction, and make it move in an eight-shape trajectory.
- The turtlebot begins in a
paused
state and believe that that configuration is (x, y, z) = (0, 0, 0), relative to it's odometry frame. - Upon calling the
resume
service, the turtlebot will enter a "moving" state and begin following the eight-shape trajectory. - Upon calling the
pause
service, the turtlebot will pause its motion, without resetting its position.
In this part I created a Xacro URDF for the robot arm shown below, visualized it in rviz, and made it's end-effector follow a trajectory.
Create a workspace, clone the repo, and build the workspace:
mkdir -p ws/src && cd ws/src
git clone https://github.com/YaelBenShalom/Turtle-Trajectories-and-Xacro-ARM.git
cd ../..
catkin_make
source devel/setup.bash
-
To activate the turtle, SSH into the turtlebot (
ssh [email protected]
) and runroslaunch turtlebot3_bringup turtlebot3_robot.launch
. -
To start running the turtlebot in figure-eight trajectory, run
roslaunch Turtle-Trajectories-and-Xacro-ARM figure_eight.launch
. The turtle begins in apaused
state.- To launch the rqt_plot and show the turtlebot's x and y position (from odometry) vs. time, add
rqt_plot:=True
to the roslaunch command.
- To launch the turtlebot Gazebo simulation, add
Gazebo:=True
to the roslaunch command.
- To launch the turtlebot Gazebo simulation, add
rviz:=True
to the roslaunch command.
- To launch the rqt_plot and show the turtlebot's x and y position (from odometry) vs. time, add
-
To move the turtle, call the service
resume
(rosservice call /resume
). -
To pause the turtle movement, call the service
pause
(rosservice call /pause
). -
To change the parameters
width
(W - the width of the figure eight),height
(H - the height of the figure eight),period
(T - the period of time it takes the turtlebot to complete the figure eight), edit the fileconfig/trajectory.yaml
-
To change the parameter
pub_freq
(R - the frequency at which we publish the cmd_vel messages) edit the filelaunch/figure_eight.launch
. -
To test the calculated values at t=0 and at t=T/2 (half a cycle), run
catkin_make run_tests
from the root of workspace. -
To see the transformation between the
world
frame and theodom
frame, runrosrun tf tf_echo /world /odom
-
To watch the rqt tree, run
rosrun rqt_tf_tree rqt_tf_tree
- To run the arm launchfile on rviz, run
roslaunch Turtle-Trajectories-and-Xacro-ARM xacro_arm.launch
. - To run the launchfile on rviz with gui, run
roslaunch Turtle-Trajectories-and-Xacro-ARM xacro_arm.launch gui:=True
- To run the arm launchfile on rviz with the marker, run
roslaunch Turtle-Trajectories-and-Xacro-ARM mark_arm.launch