36 THIS_PACKAGE =
"rosserial_vex_cortex" 39 make_libraries.py generates the VEX Cortex rosserial library files. It requires the location of the include directory of a PROS kernel. 41 rosrun rosserial_cortex make_libraries.py <pros_include_dir> 45 import rosserial_client
51 ROS_TO_EMBEDDED_TYPES = {
52 'bool' : (
'bool', 1, PrimitiveDataType, []),
53 'byte' : (
'int8_t', 1, PrimitiveDataType, []),
54 'int8' : (
'int8_t', 1, PrimitiveDataType, []),
55 'char' : (
'uint8_t', 1, PrimitiveDataType, []),
56 'uint8' : (
'uint8_t', 1, PrimitiveDataType, []),
57 'int16' : (
'int16_t', 2, PrimitiveDataType, []),
58 'uint16' : (
'uint16_t', 2, PrimitiveDataType, []),
59 'int32' : (
'int32_t', 4, PrimitiveDataType, []),
60 'uint32' : (
'uint32_t', 4, PrimitiveDataType, []),
61 'int64' : (
'int64_t', 8, PrimitiveDataType, []),
62 'uint64' : (
'uint64_t', 8, PrimitiveDataType, []),
63 'float32' : (
'float', 4, PrimitiveDataType, []),
64 'float64' : (
'float', 4, AVR_Float64DataType, []),
65 'time' : (
'ros::Time', 8, TimeDataType, [
'ros/time']),
66 'duration': (
'ros::Duration', 8, TimeDataType, [
'ros/duration']),
67 'string' : (
'char*', 0, StringDataType, []),
68 'Header' : (
'std_msgs::Header', 0, MessageDataType, [
'std_msgs/Header'])
72 if (len(sys.argv) < 2):
80 print "\nExporting to %s" % path
82 rospack = rospkg.RosPack()
85 rosserial_cortex_dir = rospack.get_path(THIS_PACKAGE)
86 shutil.copytree(rosserial_cortex_dir+
"/src/ros_lib", path+
"/ros_lib")
87 rosserial_client_copy_files(rospack, path+
"/ros_lib/")
90 rosserial_generate(rospack, path+
"/ros_lib", ROS_TO_EMBEDDED_TYPES)