Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iri_ros_scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
labrobotica
ros
iri_core
iri_ros_scripts
Commits
f1e8278b
Commit
f1e8278b
authored
11 years ago
by
Martí Morta Garriga
Browse files
Options
Downloads
Patches
Plain Diff
primers arxius WET. No s'han comprovatsvn st
parent
ad0674e4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
create_driver_package.sh
+13
-2
13 additions, 2 deletions
create_driver_package.sh
libraries/scripts_library.sh
+23
-23
23 additions, 23 deletions
libraries/scripts_library.sh
setup.bash
+2
-0
2 additions, 0 deletions
setup.bash
with
38 additions
and
25 deletions
create_driver_package.sh
+
13
−
2
View file @
f1e8278b
#!/bin/bash
# WET
# check wether the scripts path environment variable has been defined
scripts_path
=
`
echo
"
${
IRI_ROS_SCRIPTS_PATH
}
"
`
# check if scripts_path has size 0
...
...
@@ -67,7 +69,9 @@ else
echo
"Generating folder structure for project
${
project_name
}
..."
fi
roscreate-pkg
${
project_name
}
roscpp iri_base_driver
# roscreate-pkg ${project_name} roscpp iri_base_driver
# WET
catkin_create_pkg
${
project_name
}
roscpp iri_base_driver
#create driver filename
driver_filename
=
"
${
input_name
}
_driver"
...
...
@@ -162,5 +166,12 @@ echo "Project ${project_name} has been successfully created!!"
pushd
"
${
project_name
}
"
change_license_to_LGPL
rosmake
popd
# WET
cd
..
# to catkin work space
#rosmake
# WET
catkin_make
${
project_name
}
This diff is collapsed.
Click to expand it.
libraries/scripts_library.sh
+
23
−
23
View file @
f1e8278b
#!/bin/bash
#WET
case
${
ROS_ROOT
}
in
*
electric
*
)
source
"
${
ROS_ROOT
}
/tools/rosbash/rosbash"
||
kill_exit
"ROS_ROOT Not found, try to install ROS again"
;;
*
fuerte
*
)
source
"
${
ROS_ROOT
}
/../rosbash/rosbash"
||
kill_exit
"ROS_ROOT Not found, try to install ROS again"
;;
*
hydro
*
)
source
"
${
ROS_ROOT
}
/../rosbash/rosbash"
||
kill_exit
"ROS_ROOT Not found, try to install ROS again"
;;
esac
# kill_exit
...
...
@@ -194,11 +197,11 @@ function browse_files
# find_ros_message
# Validates existance of the given ros message type file in $1 with
# extension $2. When $2=action then looks for the 7 .msg created files.
# Adds message package to project
manifest
.xml if required.
# Adds message package to project
package
.xml if required.
# - $1: name of the ros message file to find
# - $2: type of the ros message file: msg, srv or action
# - $3: name of the ros pkg who wants to search the file
# (for searching
manifest
.xml to add dependency)
# (for searching
package
.xml to add dependency)
function
find_ros_message
{
if
[[
-z
$1
]]
||
[[
-z
$2
]]
||
[[
-z
$3
]]
...
...
@@ -251,13 +254,13 @@ function find_ros_message
file_pkg
=(
`
echo
${
ros_out
}
|
tr
'['
' '
|
tr
']'
' '
|
tr
'/'
' '
`
)
fi
echo
"ros_pkg=
${
ros_pkg
}
"
echo
"file_pkg=
${
file_pkg
}
"
echo
"ros_pkg=
${
ros_pkg
}
"
echo
"file_pkg=
${
file_pkg
}
"
#check if both packages are the same
if
[[
${
ros_pkg
}
!=
${
file_pkg
}
]]
then
#modify
manifest
.xml to add dependency
add_pkg_to_
manifest
${
ros_pkg
}
${
file_pkg
}
#modify
package
.xml to add dependency
add_pkg_to_
packagexml
${
ros_pkg
}
${
file_pkg
}
fi
else
...
...
@@ -265,15 +268,17 @@ echo "file_pkg=${file_pkg}"
fi
}
# add_pkg_to_manifest
# Adds $2 as dependency to $1 manifest.xml file.
# # DRY add_pkg_to_manifest
# # WET add_pkg_to_packagexml
# Adds $2 as dependency to $1 package.xml file.
# - $1: current ros package
# - $2: message ros package
function
add_pkg_to_
manifest
function
add_pkg_to_
packagexml
{
if
[[
-z
$1
]]
||
[[
-z
$2
]]
then
kill_exit
"add_pkg_to_
manifest
: missing input parameters"
kill_exit
"add_pkg_to_
packagexml
: missing input parameters"
fi
#get path where message is stored
...
...
@@ -283,21 +288,15 @@ function add_pkg_to_manifest
#go to package folder
roscd
"
${
ros_pkg
}
"
# #parse folders in path
# local parsed_path=(`echo ${file_path} | tr '/' ' '`)
# #get the penultimate folder
# local path_length=${#parsed_path[@]}
# local pkg_dep=${parsed_path[path_length-2]}
#look for package in manifest.xml and add dependency if necessary
local
pub
=
"<depend package=
\"
${
file_pkg
}
\"
/>"
local
pub1
=
$(
grep
"
${
pub
}
"
"manifest.xml"
)
#look for package in package.xml and add dependency if necessary
local
pub
=
"<build_depend package=
\"
${
file_pkg
}
\"
/>"
local
pub1
=
$(
grep
"
${
pub
}
"
"package.xml"
)
if
[[
-z
"
${
pub1
}
"
]]
then
echo
"Adding package
\"
${
file_pkg
}
\"
as dependency..."
local
comment
=
"depend package=
\"
iri_base_"
pub
=
"<depend package=
\"
${
file_pkg
}
\"\/
>"
sed
-i
-e
"/
${
comment
}
/a
\\
${
pub
}
"
"
manifest
.xml"
local
comment
=
"
build_
depend package=
\"
iri_base_"
pub
=
"<
build_
depend package=
\"
${
file_pkg
}
\"\/
>"
sed
-i
-e
"/
${
comment
}
/a
\\
${
pub
}
"
"
package
.xml"
else
echo
"Package
\"
${
file_pkg
}
\"
already added as dependency, skipping"
fi
...
...
@@ -428,9 +427,10 @@ function is_driver_or_alg_node
fi
}
# WET
function
change_license_to_LGPL
{
find
.
-name
manifest
.xml
-exec
sed
-i
-e
's:<license>.*</license>:<license>LGPL</license>:g'
{}
\;
find
.
-name
package
.xml
-exec
sed
-i
-e
's:<license>.*</license>:<license>LGPL</license>:g'
{}
\;
}
...
...
This diff is collapsed.
Click to expand it.
setup.bash
+
2
−
0
View file @
f1e8278b
#!/bin/bash
# WET
SCRIPT_PATH
=
`
realpath
"
${
BASH_SOURCE
[0]
}
"
`
export
IRI_ROS_SCRIPTS_PATH
=
${
SCRIPT_PATH
%/*
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment