diff --git a/.gitignore b/.gitignore index f7c9a052..7bde47c5 100644 --- a/.gitignore +++ b/.gitignore @@ -32,4 +32,3 @@ cmake-build-none/ /cypress-tests/package-lock.json /node/package-lock.json /website/package-lock.json -arlobot.urdf diff --git a/arlobot_ros/arlobot.urdf b/arlobot_ros/arlobot.urdf new file mode 100644 index 00000000..41ec6405 --- /dev/null +++ b/arlobot_ros/arlobot.urdf @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/setup-jazzy.sh b/setup-jazzy.sh index d15fc8b7..ada07133 100755 --- a/setup-jazzy.sh +++ b/setup-jazzy.sh @@ -408,8 +408,8 @@ printf "\n${YELLOW}[Installing dependencies for ROS build-from-source packages.] cd "${HOME}/${ROS2_WS}" rosdep install -q -y -r --from-paths src --ignore-src --rosdistro ${INSTALLING_ROS_DISTRO} -printf "\n${YELLOW}[Generating xacro URDF file.]${NC}\n" -/opt/ros/jazzy/bin/xacro "${HOME}/ArloBot/urdf/common.urdf.xacro" > "${HOME}/ArloBot/arlobot_ros/arlobot.urdf" +printf "\n${YELLOW}[Generating URDF file with xacro.]${NC}\n" +/opt/ros/jazzy/bin/xacro "${HOME}/ArloBot/urdf-xacro-source/common.urdf.xacro" > "${HOME}/ArloBot/arlobot_ros/arlobot.urdf" printf "\n${YELLOW}[(Re)Building ROS Source files.]${NC}\n" cd "${HOME}/${ROS2_WS}" diff --git a/urdf-xacro-source/Readme.MD b/urdf-xacro-source/Readme.MD new file mode 100644 index 00000000..31233888 --- /dev/null +++ b/urdf-xacro-source/Readme.MD @@ -0,0 +1,40 @@ +# ArloBot Description + +## Deploy + +This is a `urdf` XML file with Macros in it. The macros are expanded by a tool called `xacro`. + +You must use the `xacro` command to convert these files int a URDF file before running: +`colcon build` +`xacro common.urdf.xacro > ../arlobot_ros/arlobot.urdf` + +The `setup-jazzy.sh` file does this automatically. + +## Notes + +This folder holds the files that "describe" the physical +characteristics of the Arlobot. + +To view the robot model run this from a GUI session: +roslaunch arlobot_ros model_robot.launch +or use the script: +~/dev_ws/src/ArloBot/scripts/model-robot.sh + +Start with common.urdf.xacro which is what loads +the other files. It will help you see what each +file does. + +There is also an Excel Spreadsheet in the root of this +repository called ArloURDF-Calculations.xlsx that has a lot of +measurements and calculations that I used to build +these files. You can use them to help with adjustments. + +--- + +The robot's physical description is here in the .urdf.xacro files. + +While a lot of this can be ignored as cosmetic, two things are important: + +1. The physical footprint needs to be right. For arlobot though, that just means having one of the plates on board. As long as nothing sticks out from that plate, you are good. + +2. The lidar position on the robot is VERY IMPORTANT diff --git a/urdf/arlo.urdf.xacro b/urdf-xacro-source/arlo.urdf.xacro similarity index 85% rename from urdf/arlo.urdf.xacro rename to urdf-xacro-source/arlo.urdf.xacro index 655aab48..58be044a 100644 --- a/urdf/arlo.urdf.xacro +++ b/urdf-xacro-source/arlo.urdf.xacro @@ -23,7 +23,7 @@ - + @@ -31,7 +31,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -55,7 +55,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -80,7 +80,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -103,9 +103,9 @@ - + - + @@ -115,7 +115,7 @@ - + @@ -130,9 +130,9 @@ - + - + @@ -142,13 +142,13 @@ - + - + @@ -162,23 +162,23 @@ - + - + - + - + - + @@ -193,23 +193,23 @@ - + - + - + - + - + @@ -224,17 +224,17 @@ - + - + - + - + @@ -242,7 +242,7 @@ - + @@ -257,17 +257,17 @@ - + - + - + - + @@ -275,7 +275,7 @@ - + @@ -283,7 +283,7 @@ - + @@ -304,7 +304,7 @@ - + @@ -328,7 +328,7 @@ - + @@ -358,7 +358,7 @@ - + @@ -397,7 +397,7 @@ - + @@ -407,7 +407,7 @@ - + @@ -459,7 +459,7 @@ z_loc="0.06825"/> - + @@ -474,7 +474,7 @@ - + @@ -484,7 +484,7 @@ - + diff --git a/urdf/common.urdf.xacro b/urdf-xacro-source/common.urdf.xacro similarity index 100% rename from urdf/common.urdf.xacro rename to urdf-xacro-source/common.urdf.xacro diff --git a/urdf/Readme.MD b/urdf/Readme.MD deleted file mode 100644 index cc6a676a..00000000 --- a/urdf/Readme.MD +++ /dev/null @@ -1,68 +0,0 @@ -# ArloBot Description - -## Deploy - -You must use the `xacro` command to convert these files int a URDF file before running `colcon build` -`xacro common.urdf.xacro > ../arlobot.urdf` - -## Notes - -This folder holds the files that "describe" the physical -characteristics of the Arlobot. - -To view the robot model run this from a GUI session: -roslaunch arlobot_ros model_robot.launch -or use the script: -~/dev_ws/src/ArloBot/scripts/model-robot.sh - -Start with common.urdf.xacro which is what loads -the other files. It will help you see what each -file does. - -There is also an Excel Spreadsheet in the root of this -repository called ArloURDF-Calculations.xlsx that has a lot of -measurements and calculations that I used to build -these files. You can use them to help with adjustments. - -These files are based off of the files in: -roscd turtlebot_description/urdf/ - ---- - -The robot's physical description is here in the .urdf.xacro files. - -While a lot of this can be ignored as cosmetic, two things are important: - -1. The physical footprint needs to be right. For arlobot though, that just means having one of the plates on board. As long as nothing sticks out from that plate, you are good. - -2. The camera position on the robot is VERY IMPORTANT - -There are two "sets" of files in here: -The 'default' or normal and the 'chrisl8' files. -I added the 'chrisl8' files so my constant robot changes wouldn't cause problems for everybody updating their data from github. - -You an switch which files are loaded by the web site and scripts in -`~/.arlobot/personalDataForBehavior.json` - -You can even make your own personal set and load those. - -The common_*.urdf.xacro file is what calls the other files. -The 3d_camera_position*.urdf.xacro is where you set the camera position. -The arlo*.urdf.xacro is where you set up all of the robot's characteristics. -The asus_xtion_pro*.urdf.xacro should generally not be edited. It is the xtion cameara setup. The one exception is that the cam_py left/right offset is set in there. If you camera is centered on your robot, then the given offset accounts for the camera being offset in the xtion itself. If your camera isn't centered left to right though, you may have to edit this. -NOTE: The camera IS offset, so be careful trying to get exact centers with markers. Because the camera is off center it can be confusing. - -The way I calibrate the camera is this: - -1. Set the robot on the floor with both axles exactly 1 meter from a solid wall. In other words, square to the wall. The axles are line up with the robot's exact center. - -2. Start up Slam Toolbox, but don't move the robot at all. - -3. Open up RVIZ and make sure you have the robot, the xtion data and the grid visible. -Look to see if the line that the xtion makes is on the 1 meter grid line in front of the robot. - -If it needs to be brought closer or further from the robot adjust the cam_px value in 3d_camera_position_chrisl8.urdf.xacro - -If the line is rotated in relation to the wall, adjust the cam_oy value. - -You can also adjust the height of the camera with cam_pz, although this is less important, since the map is "2D".