ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

trc123's profile - activity

2014-08-31 00:54:24 -0500 received badge  Famous Question (source)
2014-08-17 19:42:31 -0500 received badge  Famous Question (source)
2014-08-08 07:47:15 -0500 received badge  Notable Question (source)
2014-08-08 05:22:40 -0500 commented answer Rosrun as super user

Thank you, I needed to rebooting.

2014-08-08 05:05:11 -0500 received badge  Popular Question (source)
2014-08-08 04:43:00 -0500 commented question Rosrun as super user

How can this be done?

2014-08-08 04:35:57 -0500 asked a question Rosrun as super user

Hello, I have some code in my ros node (within a catkin workspace) that requires super user privilege in order to access some serial ports. How can this be done as sudo does not work with rosrun.

Thanks.

Edit: This is using the admin account:

$groups ros
ros : ros adm dialout cdrom sudo dip plugdev lpadmin sambashare
2014-08-05 07:10:19 -0500 received badge  Notable Question (source)
2014-08-05 05:38:00 -0500 received badge  Scholar (source)
2014-08-05 05:36:39 -0500 commented answer Message type can't be found with catkin_make

I've done that and changed bot to bot1 and I still get: add_custom_target cannot create target "bot1_generate_messages_lisp" because another target with the same name already exists.

2014-08-05 05:35:38 -0500 received badge  Supporter (source)
2014-08-05 04:51:25 -0500 received badge  Popular Question (source)
2014-08-05 04:41:25 -0500 commented answer Message type can't be found with catkin_make

Please can you see the edit.

2014-08-05 04:39:21 -0500 received badge  Editor (source)
2014-08-05 04:33:07 -0500 edited question Message type can't be found with catkin_make

So I'm trying to make a publisher to publish some data from a speed controller and I know how I can get the data. I decided to use a custom message almost the same to the Pose.msg in turtlesim (with fewer fields). However whenever I run catkin make I get this error.

/home/ros/catkin_ws/src/bot/src/wheeldata.cpp: In function ‘int main(int, char**)’:
/home/ros/catkin_ws/src/bot/src/wheeldata.cpp:19:36: error: ‘Pose’ was not declared in this scope
/home/ros/catkin_ws/src/bot/src/wheeldata.cpp:19:36: note: suggested alternative:
/home/ros/catkin_ws/devel/include/bot/Pose.h:85:45: note:   ‘bot::Pose’
/home/ros/catkin_ws/src/bot/src/wheeldata.cpp:19:59: error: no matching function for call to ‘ros::NodeHandle::advertise(const char [10], int)’
/home/ros/catkin_ws/src/bot/src/wheeldata.cpp:19:59: note: candidates are:
/opt/ros/hydro/include/ros/node_handle.h:236:15: note: template<class M> ros::Publisher ros::NodeHandle::advertise(const string&, uint32_t, bool)
/opt/ros/hydro/include/ros/node_handle.h:300:13: note: template<class M> ros::Publisher ros::NodeHandle::advertise(const string&, uint32_t, const SubscriberStatusCallback&, const SubscriberStatusCallback&, const VoidConstPtr&, bool)
/home/ros/catkin_ws/src/bot/src/wheeldata.cpp:29:8: error: expected ‘;’ before ‘p’
/home/ros/catkin_ws/src/bot/src/wheeldata.cpp:30:3: error: ‘p’ was not declared in this scope
make[2]: *** [bot/CMakeFiles/wheeldata.dir/src/wheeldata.cpp.o] Error 1
make[1]: *** [bot/CMakeFiles/wheeldata.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

Here is the CMakeList.txt:

cmake_minimum_required(VERSION 2.8.3)
project(bot)


find_package(catkin REQUIRED COMPONENTS
  roscpp
  std_msgs
  message_generation
  bot
)

################################################
## Declare ROS messages, services and actions ##
################################################
## Generate messages in the 'msg' folder
add_message_files( DIRECTORY msg
   FILES
   Pose.msg
)

## Generate added messages and services with any dependencies listed here
#generate_messages(
#  DEPENDENCIES
#  std_msgs

#)


catkin_package(CATKIN_DEPENDS
roscpp 
std_msgs
message_runtime 
)

catkin_package()

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
  ${catkin_INCLUDE_DIRS}
)

## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes
# add_dependencies(bot_node bot_generate_messages_cpp)



# include_directories(include ${catkin_INCLUDE_DIRS})

 add_executable(wheeldata src/wheeldata.cpp)
 target_link_libraries(wheeldata ${catkin_LIBRARIES})
 add_dependencies(wheeldata bot_generate_messages_cpp)

Here is the package.xml:

<?xml version="1.0"?>
<package>
  <name>bot</name>
  <version>0.0.0</version>
  <description>The bot package</description>


  <!-- The *_depend tags are used to specify dependencies -->
  <!-- Dependencies can be catkin packages or system dependencies -->
  <!-- Examples: -->
  <!-- Use build_depend for packages you need at compile time: -->
  <build_depend>message_generation</build_depend>
  <!-- Use buildtool_depend for build tool packages: -->
  <!--   <buildtool_depend>catkin</buildtool_depend> -->
  <!-- Use run_depend for packages you need at runtime: -->
  <run_depend>message_runtime</run_depend>
  <!-- Use test_depend for packages you need only for testing: -->
  <!--   <test_depend>gtest</test_depend> -->
  <buildtool_depend>catkin</buildtool_depend>
  <build_depend>roscpp</build_depend>
  <build_depend>rospy</build_depend>
  <build_depend>std_msgs</build_depend>
  <run_depend>roscpp</run_depend>
  <run_depend>rospy</run_depend>
  <run_depend>std_msgs</run_depend>


  <!-- The export tag contains other, unspecified, tags -->
  <export>
    <!-- You can specify that this package is a metapackage here: -->
    <!-- <metapackage/> -->

    <!-- Other tools can ...
(more)
2014-08-05 04:30:08 -0500 commented answer Message type can't be found with catkin_make

sorry, I do have these includes, for some reason I didn't paste them in: #include "ros/ros.h" #include "std_msgs/String.h" #include "bot/Pose.h"