-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ SCRIPTING ] : Adds Installations script #71
Conversation
mario_install.sh
Outdated
if [ ! -d "$HOME/MARIO" ]; then | ||
cd "$HOME" || (echo "Error: Could not navigate to Home" && exit 1) | ||
echo "Cloning Mario" | ||
git clone --recursive https://github.com/AryanNanda17/MARIO.git /tmp/ros2_ws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line clones your fork @AryanNanda17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it!
mario_install.sh
Outdated
if [ ! -d "$HOME/MARIO" ]; then | ||
cd "$HOME" || (echo "Error: Could not navigate to Home" && exit 1) | ||
echo "Cloning Mario" | ||
git clone --recursive https://github.com/AryanNanda17/MARIO.git /tmp/ros2_ws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will be renaming ros2 branch as humble, so accordingly you have to clone the branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do I need to clone just the humble branch or the entire repository?
mario_install.sh
Outdated
if [ ! -d "$HOME/MARIO" ]; then | ||
cd "$HOME" || (echo "Error: Could not navigate to Home" && exit 1) | ||
echo "Cloning Mario" | ||
git clone --recursive https://github.com/AryanNanda17/MARIO.git /tmp/ros2_ws |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and why is it cloned in /tmp/ros2_ws?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cloning of the repository is temporary as the script will later copy the folders to ros2_ws and ros2_ws_firmware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think its better to have the MARIO folder in home directory still for future contributors
mario_install.sh
Outdated
|
||
# Install additional important ros2 packages | ||
echo "Installing Additional Ros2 packages" | ||
conda install ros-humble-desktop-full ros-humble-control-* ros-humble-gazebo-ros2-control ros-humble-joint-state-* ros-humble-forward-command-controller ros-humble-robot-state-publisher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ros-humble-control*
we need controller manager as well
mario_install.sh
Outdated
|
||
# Install additional important ros2 packages | ||
echo "Installing Additional Ros2 packages" | ||
conda install ros-humble-desktop-full ros-humble-control-* ros-humble-gazebo-ros2-control ros-humble-joint-state-* ros-humble-forward-command-controller ros-humble-robot-state-publisher |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, add ros-humble-joint-trajectory-controller
mario_install.sh
Outdated
|
||
cd ~/ros2_ws/src | ||
if [[ ! -d "1_chatter_listener" ]]; then | ||
mv /tmp/ros2_ws/1_* $HOME/ros2_ws/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't do this, just clone in MARIO
folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't do this, just clone in
MARIO
folder
In the Discord, you advised doing that and not against it. So, should I proceed with copying these folders to the ros2_ws or not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should copy still, just not clone in tmp thing
mario_install.sh
Outdated
case "${unameOut}" in | ||
Linux*) | ||
echo "Creating a microros_ws" | ||
mkdir -p microros_ws/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clone in the ros2_ws only
mario_install.sh
Outdated
;; | ||
Darwin*) | ||
echo "Creating a microros_ws" | ||
mkdir -p microros_ws/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you need to install catkin_pkg and all in macos?
mario_install.sh
Outdated
cd ~/ros2_ws | ||
mkdir src | ||
colcon build | ||
echo "source ~/ros2_ws/install/setup.bash" >> $HOME/."$_shell_"rc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add alias for sourcing
`sw = source install/setup.bash
and get_ros = source /opt/ros/humble/setup.bash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add alias for sourcing `sw = source install/setup.bash
and
get_ros = source /opt/ros/humble/setup.bash
I've included a sourcing command in the terminal to ensure that the specified commands are automatically available whenever the user opens the terminal, this eliminates the need to manually execute them each time.
@AryanNanda17 I don't see any commit resolving the bugs |
mario_install.sh
Outdated
git clone -b humble https://github.com/micro-ROS/micro-ROS-Agent.git | ||
sudo apt update && rosdep update | ||
cd .. | ||
pip3 install catkin_pkg lark-parser colcon-common-extensions -l rosdep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
microros-esp-idf-components depends on this, so its good
mario_install.sh
Outdated
echo "${red}======================$reset" | ||
cd ~/ros2_ws/src | ||
|
||
git clone -b humble https://github.com/micro-ROS/micro-ROS-Agent.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you tested the script with the microros folders in the firmware ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am solving errors since the afternoon, but I am getting one error after another. I am not able to setup catkin_pkg in MacOS and I am getting this error when I try to run colcon build command in ros_ws
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip3 install catkin_pkg lark-parser colcon-common-extensions -l rosdep
isn't it same for mac?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the same and I did that but still, I am getting the same error.
mario_install.sh
Outdated
echo "${red}======================$reset" | ||
cd ~/ros2_ws/src | ||
|
||
git clone -b humble https://github.com/micro-ROS/micro-ROS-Agent.git |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pip3 install catkin_pkg lark-parser colcon-common-extensions -l rosdep
isn't it same for mac?
mario_install.sh
Outdated
|
||
cd ~/ros2_ws/src | ||
if [[ ! -d "1_chatter_listener" ]]; then | ||
mv ~/ros2_ws/1_* $HOME/ros2_ws/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't it be ~/MARIO/1_* and so on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, updated it!
@SuperChamp234, could you please try running the installation script?
|
@AryanNanda17 also, please rename this file to install_codes.sh and remove other shell scripts from previous version of MARIO |
Hi Aryan, can you ask other team members to run the installation scripts? Both on Linux and Mac. I cannot run as I have an install of ROS for my work running and don’t want to disturb it. |
And for linux it might be the same issue that the gazebo-ros package is not installed for macOS for gazebo-ros2-control what command you used |
@SuperChamp234 please see what's the issue with gazebo-ros2-control |
yes I used |
@AryanNanda17 send the gazebo error in pastebin |
installations.sh
Outdated
|
||
# Install additional ROS 2 packages | ||
echo "Installing Additional Ros2 packages" | ||
sudo apt install -y ros-humble-control-msgs ros-humble-control-toolbox ros-humble-gazebo-ros2-control ros-humble-joint-state-broadcaster ros-humble-joint-state-publisher ros-humble-joint-state-publisher-gui ros-humble-forward-command-controller ros-humble-robot-state-publisher ros-humble-gazebo-ros2-control ros-humble-robot-controllers ros-humble-robot-controllers-interface ros-humble-robot-controllers-msgs ros-humble-joint-trajectory-controller ros-humble-controller-manager ros-humble-controller-manager-msgs ros-humble-ros2-control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is gazebo-ros2-control mentioned two times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected it!
installations.sh
Outdated
conda config --env --remove channels defaults || true | ||
# Install ROS packages | ||
mamba install ros-humble-desktop-full | ||
mamba install -n ros_env -y ros-humble-control-msgs ros-humble-control-toolbox ros-humble-joint-state-broadcaster ros-humble-joint-state-publisher ros-humble-joint-state-publisher-gui ros-humble-forward-command-controller ros-humble-robot-state-publisher ros-humble-controller-manager ros-humble-controller-manager-msgs ros-humble-joint-trajectory-controller ros-humble-ros2-control |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
review the previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it is correct right?
For Mac:- |
Solve the mac errors by tomorrow, I will merge then tomorrow morning! |
case "${unameOut}" in | ||
Linux*) | ||
echo "Cloning microrosagent" | ||
cd $HOME/ros2_ws/src |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is cloning step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I missed cloning it here. Thanks for pointing it out @aPR0T0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please look into suggested changes. @SuperChamp234, Can you review the suggestions.
installations.sh
Outdated
fi | ||
echo "$reset" | ||
# Clone Mario repository if not already cloned | ||
if [ ! -d "$HOME/MARIO" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using double inverted commas won't work. Make changes as per line 14 for esp folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using double inverted commas won't work. Make changes as per line 14 for the esp folder.
Hello @RapidRoger18, enclosing a string in double quotes indeed does work. When you use double quotes, variables, and certain special characters within the quotes get expanded.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still, in order to maintain consistency, I have removed the double quotes.
Thanks for the suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might have not pushed the changes @AryanNanda17 as I am unable to see removed quotes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pushed now.
installations.sh
Outdated
|
||
echo "Installing ESP IDF" | ||
|
||
_shell_="${SHELL#${SHELL%/*}/}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions: I would recommend using $0 command instead of $SHELL as some systems print shell path. Instead of concatenation $0 will always give shell name only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. Updated it!
|
||
# Install ROS 2 | ||
sudo apt install ros-humble-desktop-full | ||
echo "source /opt/ros/humble/setup.bash" >> $HOME/."$_shell_"rc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are identifying shell for each system better to use $0 to run the a particular shell script instead of using bash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 113 will only be executed in the case of linux, where Bash serves as the default shell.
@@ -0,0 +1,297 @@ | |||
!/usr/bin/env bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are using bash from env why bother using $shell??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a script starts with #!/usr/bin/env bash, it tells the system to execute the script using the bash interpreter found in the environment. In this context, $0 technically represents the script's filename, not the shell being used.
@AryanNanda17 please go through this gist and make the generic changes |
This PR resolves issue #30.
The installation script provides a complete installation process for MARIO Workshop, which includes the following steps:-
To do: Adding instructions for building microros_ws in MacOS.
I will verify the installation on both Linux and macOS systems and provide an update soon.