Skip to content
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

[roseus] Resolve jade error on prs of #370 and #369 #373

Merged
merged 4 commits into from
Sep 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions roseus/euslisp/actionlib.l
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
cancel-topic (ros::get-num-subscribers cancel-topic))
(send self :spin-once)
(ros::sleep)
(when (and (> count 0) (= 0 (mod count 50)))
(ros::ros-warn "Still waiting for [~A] action server. ~A seconds have passed." name-space (/ count 10))
)
(when (and timeout (>= count (* timeout 10)))
(ros::ros-warn "[~A] action server is not found" name-space)
(ros::ros-warn " goal=~d, cancel=~d, feedback=~d, result=~d"
Expand Down
48 changes: 48 additions & 0 deletions roseus/roseus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/algorithm/string.hpp>

#include <ros/init.h>
#include <ros/time.h>
Expand Down Expand Up @@ -1386,6 +1387,52 @@ pointer ROSEUS_ROSPACK_FIND(register context *ctx,int n,pointer *argv)
return(NIL);
}

pointer ROSEUS_ROSPACK_PLUGINS(register context *ctx,int n,pointer *argv)
{
// (ros::rospack-plugins package-name attibute-name)
ckarg(2);
string pkg, attrib;
numunion nu;
pointer ret, first;
if (isstring(argv[0])) pkg.assign((char *)get_string(argv[0]));
else error(E_NOSTRING);
if (isstring(argv[1])) attrib.assign((char *)get_string(argv[1]));
else error(E_NOSTRING);
try {
rospack::Rospack rp;
std::vector<std::string> search_path;
rp.getSearchPathFromEnv(search_path);
rp.crawl(search_path, 1);
std::vector<std::string> flags;
if (rp.plugins(pkg, attrib, "", flags)) {
ret = cons(ctx, NIL, NIL);
first = ret;
vpush(ret);
for (size_t i = 0; i < flags.size(); i++) {
// flags[i] = laser_proc /opt/ros/hydro/share/laser_proc/nodelets.xml
std::vector<std::string> parsed_string;
boost::algorithm::split(parsed_string, flags[i], boost::is_any_of(" "));
std::string package = parsed_string[0];
std::string value = parsed_string[1];
pointer tmp = cons(ctx, cons(ctx,
makestring((char*)package.c_str(), package.length()),
makestring((char*)value.c_str(), value.length())),
NIL);
ccdr(ret) = tmp;
ret = tmp;
}
vpop(); // ret
return ccdr(first);
}
else {
return(NIL);
}
}
catch (runtime_error &e) {
}
return(NIL);
}

pointer ROSEUS_RESOLVE_NAME(register context *ctx,int n,pointer *argv)
{
ckarg(1);
Expand Down Expand Up @@ -1742,6 +1789,7 @@ pointer ___roseus(register context *ctx, int n, pointer *argv, pointer env)
_defun(ctx,"HAS-PARAM",argv[0],(pointer (*)())ROSEUS_HAS_PARAM, "Check whether a parameter exists on the parameter server.");

_defun(ctx,"ROSPACK-FIND",argv[0],(pointer (*)())ROSEUS_ROSPACK_FIND, "Returns ros package path");
_defun(ctx,"ROSPACK-PLUGINS",argv[0],(pointer (*)())ROSEUS_ROSPACK_PLUGINS, "Returns plugins of ros packages");
_defun(ctx,"RESOLVE-NAME",argv[0],(pointer (*)())ROSEUS_RESOLVE_NAME, "Returns ros resolved name");
_defun(ctx,"GET-NAME",argv[0],(pointer (*)())ROSEUS_GETNAME, "Returns current node name");
_defun(ctx,"GET-NAMESPACE",argv[0],(pointer (*)())ROSEUS_GETNAMESPACE, "Returns current node name space");
Expand Down